diff options
author | Chao Yu <chao2.yu@samsung.com> | 2014-08-20 12:36:46 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-08-21 22:57:06 +0200 |
commit | c200b1aa6cb460ce8c3ecf6fdc690d3949c3cc5d (patch) | |
tree | 527fda78fcfcd4a879766e3c38cf8041fc10f1e8 /include | |
parent | f2fs: remove rename and use rename2 (diff) | |
download | linux-c200b1aa6cb460ce8c3ecf6fdc690d3949c3cc5d.tar.xz linux-c200b1aa6cb460ce8c3ecf6fdc690d3949c3cc5d.zip |
f2fs: fix incorrect calculation with total/free inode num
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/f2fs_fs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index 6ff0b0b42d47..0ed77f32c9ac 100644 --- a/include/linux/f2fs_fs.h +++ b/include/linux/f2fs_fs.h @@ -24,6 +24,9 @@ #define NULL_ADDR ((block_t)0) /* used as block_t addresses */ #define NEW_ADDR ((block_t)-1) /* used as block_t addresses */ +/* 0, 1(node nid), 2(meta nid) are reserved node id */ +#define F2FS_RESERVED_NODE_NUM 3 + #define F2FS_ROOT_INO(sbi) (sbi->root_ino_num) #define F2FS_NODE_INO(sbi) (sbi->node_ino_num) #define F2FS_META_INO(sbi) (sbi->meta_ino_num) |