aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.h
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2019-07-02 15:23:07 +0100
committerDavid Sterba <dsterba@suse.com>2019-09-09 14:59:02 +0200
commitb64119b5f0438da68a0927e4200c70d7bf8fbb60 (patch)
treec51e6d3267cdf3491cf415dfb279ce538278a0d0 /fs/btrfs/volumes.h
parentbtrfs: Refactor btrfs_calc_avail_data_space (diff)
downloadlinux-dev-b64119b5f0438da68a0927e4200c70d7bf8fbb60.tar.xz
linux-dev-b64119b5f0438da68a0927e4200c70d7bf8fbb60.zip
Btrfs: remove unnecessary condition in btrfs_clone() to avoid too much nesting
The bulk of the work done when cloning extents, at ioctl.c:btrfs_clone(), is done inside an if statement that checks if the found key has the type BTRFS_EXTENT_DATA_KEY. That if statement is redundant however, because btrfs_search_slot() always leaves us in a leaf slot that points to a key that is always greater then or equals to the search key, and our search key here has that type, and because we bail out before that if statement if the key at the given leaf slot is greater then BTRFS_EXTENT_DATA_KEY. Therefore just remove that if statement, not only because it is useless but mostly because it increases the nesting/indentation level in this function which is quite big and makes things a bit awkward whenever I need to fix something that requires changing btrfs_clone() (and it has been like that for many years already). Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.h')
0 files changed, 0 insertions, 0 deletions