On Tue, Jul 02, 2019 at 03:23:07PM +0100, [email protected] wrote:
> From: Filipe Manana <[email protected]>
> 
> 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 <[email protected]>

Added to misc-next, thanks.

Reply via email to