f2fs: calculate the f2fs_stat_info into base_mem
authorKinglong Mee <kinglongmee@gmail.com>
Sat, 18 Mar 2017 01:25:05 +0000 (09:25 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 22 Mar 2017 02:34:36 +0000 (22:34 -0400)
The memory size of f2fs_stat_info also should be calculated.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/debug.c

index ee2d0a4..ef1179d 100644 (file)
@@ -156,7 +156,11 @@ static void update_mem_info(struct f2fs_sb_info *sbi)
        if (si->base_mem)
                goto get_cache;
 
-       si->base_mem = sizeof(struct f2fs_sb_info) + sbi->sb->s_blocksize;
+       /* build stat */
+       si->base_mem = sizeof(struct f2fs_stat_info);
+
+       /* build superblock */
+       si->base_mem += sizeof(struct f2fs_sb_info) + sbi->sb->s_blocksize;
        si->base_mem += 2 * sizeof(struct f2fs_inode_info);
        si->base_mem += sizeof(*sbi->ckpt);
        si->base_mem += sizeof(struct percpu_counter) * NR_COUNT_TYPE;