f2fs: Allocate and stat mem used by free nid bitmap more accurately
This patch used f2fs_bitmap_size macro to calculate mem used by free nid bitmap, and stat used mem including aligned part. Signed-off-by: Yunlei He <heyunlei@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
@@ -2797,7 +2797,7 @@ static int init_free_nid_cache(struct f2fs_sb_info *sbi)
|
||||
|
||||
for (i = 0; i < nm_i->nat_blocks; i++) {
|
||||
nm_i->free_nid_bitmap[i] = f2fs_kvzalloc(sbi,
|
||||
NAT_ENTRY_BITMAP_SIZE_ALIGNED, GFP_KERNEL);
|
||||
f2fs_bitmap_size(NAT_ENTRY_PER_BLOCK), GFP_KERNEL);
|
||||
if (!nm_i->free_nid_bitmap)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
Reference in New Issue
Block a user