f2fs: fix to show ino management cache size correctly
authorChao Yu <yuchao0@huawei.com>
Fri, 29 Sep 2017 05:59:37 +0000 (13:59 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 19 Dec 2017 01:21:47 +0000 (17:21 -0800)
It needs to stat size of ino management cache with all type instead of
orphan ino type.

Fixes: 652be55162dc ("f2fs: show # of orphan inodes")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/debug.c

index 14095fbb4039b1b46011fd8772aa2d3e5e2d40c6..d441660c3ba6fb5195e1ab44002b00502de9b67f 100644 (file)
@@ -240,7 +240,7 @@ get_cache:
        si->cache_mem += NM_I(sbi)->dirty_nat_cnt *
                                        sizeof(struct nat_entry_set);
        si->cache_mem += si->inmem_pages * sizeof(struct inmem_pages);
-       for (i = 0; i <= ORPHAN_INO; i++)
+       for (i = 0; i < MAX_INO_ENTRY; i++)
                si->cache_mem += sbi->im[i].ino_num * sizeof(struct ino_entry);
        si->cache_mem += atomic_read(&sbi->total_ext_tree) *
                                                sizeof(struct extent_tree);