btrfs: send: avoid unnecessary path allocations when finding extent clone
authorFilipe Manana <fdmanana@suse.com>
Tue, 1 Nov 2022 16:15:41 +0000 (16:15 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Dec 2022 17:00:49 +0000 (18:00 +0100)
commit61ce908a3c260fbe37826a6cbd56636abeffcd28
tree4c6cd6f7c7cd093d977f57f99f291eb2fa506836
parent1a1a285139707f2430b3833103e152f07c66e63e
btrfs: send: avoid unnecessary path allocations when finding extent clone

When looking for an extent clone, at find_extent_clone(), we start by
allocating a path and then check for cases where we can't have clones
and exit immediately in those cases. It's a waste of time to allocate
the path before those cases, so reorder the logic so that we check for
those cases before allocating the path.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/send.c