diff options
author | Christoph Hellwig <hch@lst.de> | 2022-11-28 12:15:19 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2023-01-07 02:13:26 +0300 |
commit | ffdeab71d5cf0bcd45467b3badb3a1ef8f19a565 (patch) | |
tree | 501fe81b5f3705067d383b97d299b6697b509af3 /fs/f2fs | |
parent | a9e292f2aeb737b263b1c14281be239405e1bb19 (diff) | |
download | linux-ffdeab71d5cf0bcd45467b3badb3a1ef8f19a565.tar.xz |
f2fs: remove f2fs_get_block
Fold f2fs_get_block into the two remaining callers to simplify the
call chain a bit.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/data.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 697020cef820..e6f94591717b 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1212,14 +1212,6 @@ int f2fs_reserve_block(struct dnode_of_data *dn, pgoff_t index) return err; } -static int f2fs_get_block(struct dnode_of_data *dn, pgoff_t index) -{ - if (f2fs_lookup_read_extent_cache_block(dn->inode, index, - &dn->data_blkaddr)) - return 0; - return f2fs_reserve_block(dn, index); -} - struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index, blk_opf_t op_flags, bool for_write, pgoff_t *next_pgofs) @@ -1469,10 +1461,12 @@ static void f2fs_map_unlock(struct f2fs_sb_info *sbi, int flag) int f2fs_get_block_locked(struct dnode_of_data *dn, pgoff_t index) { struct f2fs_sb_info *sbi = F2FS_I_SB(dn->inode); - int err; + int err = 0; f2fs_map_lock(sbi, F2FS_GET_BLOCK_PRE_AIO); - err = f2fs_get_block(dn, index); + if (!f2fs_lookup_read_extent_cache_block(dn->inode, index, + &dn->data_blkaddr)) + err = f2fs_reserve_block(dn, index); f2fs_map_unlock(sbi, F2FS_GET_BLOCK_PRE_AIO); return err; @@ -3450,7 +3444,9 @@ static int __reserve_data_block(struct inode *inode, pgoff_t index, } set_new_dnode(&dn, inode, ipage, ipage, 0); - err = f2fs_get_block(&dn, index); + if (!f2fs_lookup_read_extent_cache_block(dn.inode, index, + &dn.data_blkaddr)) + err = f2fs_reserve_block(&dn, index); *blk_addr = dn.data_blkaddr; *node_changed = dn.node_changed; |