aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorQu Wenruo <[email protected]>2023-10-30 21:07:20 +0000
committerDavid Sterba <[email protected]>2023-12-15 19:27:00 +0000
commit9ba7c686feb04f16088ca4523c204ed49b07fc0a (patch)
treebacd94b4a77f5492b20a3f06389833f37e2d5d1c /fs/btrfs/inode.c
parentbtrfs: make the logic from btrfs_block_can_be_shared() easier to read (diff)
downloadkernel-9ba7c686feb04f16088ca4523c204ed49b07fc0a.tar.gz
kernel-9ba7c686feb04f16088ca4523c204ed49b07fc0a.zip
btrfs: do not utilize goto to implement delayed inode ref deletion
[PROBLEM] The function __btrfs_update_delayed_inode() is doing something not meeting the code standard of today: path->slots[0]++ if (path->slots[0] >= btrfs_header_nritems(leaf)) goto search; again: if (!is_the_target_inode_ref()) goto out; ret = btrfs_delete_item(); /* Some cleanup. */ return ret; search: ret = search_for_the_last_inode_ref(); goto again; With the tag named "again", it's pretty common to think it's a loop, but the truth is, we only need to do the search once, to locate the last (also the first, since there should only be one INODE_REF or INODE_EXTREF now) ref of the inode. [FIX] Instead of the weird jumps, just do them in a stream-lined fashion. This removes those weird labels, and add extra comments on why we can do the different searches. Reviewed-by: Filipe Manana <[email protected]> Signed-off-by: Qu Wenruo <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/inode.c')
0 files changed, 0 insertions, 0 deletions