mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-07 13:43:51 +00:00
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>
This commit is contained in:
parent
44b0dfebbd
commit
3cf684f2f8
@ -1431,13 +1431,12 @@ static int __allocate_data_block(struct dnode_of_data *dn, int seg_type)
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
dn->data_blkaddr = f2fs_data_blkaddr(dn);
|
dn->data_blkaddr = f2fs_data_blkaddr(dn);
|
||||||
if (dn->data_blkaddr != NULL_ADDR)
|
if (dn->data_blkaddr == NULL_ADDR) {
|
||||||
goto alloc;
|
err = inc_valid_block_count(sbi, dn->inode, &count);
|
||||||
|
if (unlikely(err))
|
||||||
if (unlikely((err = inc_valid_block_count(sbi, dn->inode, &count))))
|
|
||||||
return err;
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
alloc:
|
|
||||||
set_summary(&sum, dn->nid, dn->ofs_in_node, ni.version);
|
set_summary(&sum, dn->nid, dn->ofs_in_node, ni.version);
|
||||||
old_blkaddr = dn->data_blkaddr;
|
old_blkaddr = dn->data_blkaddr;
|
||||||
f2fs_allocate_data_block(sbi, NULL, old_blkaddr, &dn->data_blkaddr,
|
f2fs_allocate_data_block(sbi, NULL, old_blkaddr, &dn->data_blkaddr,
|
||||||
|
Loading…
Reference in New Issue
Block a user