f2fs: fix incorrect calculation with total/free inode num
authorChao Yu <chao2.yu@samsung.com>
Wed, 20 Aug 2014 10:36:46 +0000 (18:36 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 21 Aug 2014 20:57:06 +0000 (13:57 -0700)
Theoretically, our total inodes number is the same as total node number, but
there are three node ids are reserved in f2fs, they are 0, 1 (node nid), and 2
(meta nid), and they should never be used by user, so our total/free inode
number calculated in ->statfs is wrong.

This patch indroduces F2FS_RESERVED_NODE_NUM and then fixes this issue by
recalculating total/free inode number with the macro.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/node.c
fs/f2fs/super.c
include/linux/f2fs_fs.h

diff --cc fs/f2fs/node.c
Simple merge
diff --cc fs/f2fs/super.c
Simple merge
Simple merge