diff options
author | Christoph Hellwig <hch@lst.de> | 2022-11-28 10:15:18 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2023-01-07 00:13:13 +0100 |
commit | 3cf684f2f8e0229714fb6d051508b42d3320e78f (patch) | |
tree | 9ba5e04d5c2679ff9a7d66a53d6c7ad517a6dc8f /fs/f2fs/data.c | |
parent | f2fs: reflow prepare_write_begin (diff) | |
download | linux-3cf684f2f8e0229714fb6d051508b42d3320e78f.tar.xz linux-3cf684f2f8e0229714fb6d051508b42d3320e78f.zip |
f2fs: simplify __allocate_data_block
Just use a simple if block for the conditional call to
inc_valid_block_count.
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/data.c')
-rw-r--r-- | fs/f2fs/data.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index efd3ebaa4fc8..697020cef820 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1431,13 +1431,12 @@ static int __allocate_data_block(struct dnode_of_data *dn, int seg_type) return err; dn->data_blkaddr = f2fs_data_blkaddr(dn); - if (dn->data_blkaddr != NULL_ADDR) - goto alloc; - - if (unlikely((err = inc_valid_block_count(sbi, dn->inode, &count)))) - return err; + if (dn->data_blkaddr == NULL_ADDR) { + err = inc_valid_block_count(sbi, dn->inode, &count); + if (unlikely(err)) + return err; + } -alloc: set_summary(&sum, dn->nid, dn->ofs_in_node, ni.version); old_blkaddr = dn->data_blkaddr; f2fs_allocate_data_block(sbi, NULL, old_blkaddr, &dn->data_blkaddr, |