f2fs: fix wrong statistics of inline data
authorChao Yu <chao2.yu@samsung.com>
Mon, 7 Apr 2014 03:18:34 +0000 (11:18 +0800)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Mon, 7 Apr 2014 03:40:58 +0000 (12:40 +0900)
If we remove a file that has inline data after mount, our statistics turns to
inaccurate.

cat /sys/kernel/debug/f2fs/status
  - Inline_data Inode: 4294967295

Let's add stat_inc_inline_inode() to stat inline info of the file when lookup.

Change log from v1:
 o stat in f2fs_lookup() instead of in do_read_inode() for excluding wrong stat.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/namei.c

index 0cea874..a9409d1 100644 (file)
@@ -207,6 +207,8 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
                inode = f2fs_iget(dir->i_sb, ino);
                if (IS_ERR(inode))
                        return ERR_CAST(inode);
+
+               stat_inc_inline_inode(inode);
        }
 
        return d_splice_alias(inode, dentry);