diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-12-31 09:35:37 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-01-04 08:40:04 +0300 |
commit | e0afc4d6d0d3e7e5a99f691bc64ae7c74bea790e (patch) | |
tree | 76cdea35b5c446a7b0137c1a4849f47d7d801e35 /fs/f2fs/data.c | |
parent | 3a9e6433a367211a172cb7b4d5b727c720bd0de0 (diff) | |
download | linux-e0afc4d6d0d3e7e5a99f691bc64ae7c74bea790e.tar.xz |
f2fs: introduce max_file_blocks in sbi
Introduce max_file_blocks in sbi to store max block index of file in f2fs,
it could be used to avoid unneeded calculation of max block index in
runtime.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
[Jaegeuk Kim: fix overflow of sbi->max_file_blocks]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 4851e84d0283..89a978c57da9 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -762,7 +762,7 @@ static int get_data_block_bmap(struct inode *inode, sector_t iblock, struct buffer_head *bh_result, int create) { /* Block number less than F2FS MAX BLOCKS */ - if (unlikely(iblock >= max_file_size(0))) + if (unlikely(iblock >= F2FS_I_SB(inode)->max_file_blocks)) return -EFBIG; return __get_data_block(inode, iblock, bh_result, create, |