btrfs: Always use a cached extent_state in btrfs_lock_and_flush_ordered_range
authorNikolay Borisov <nborisov@suse.com>
Tue, 7 May 2019 07:19:24 +0000 (10:19 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 1 Jul 2019 11:34:59 +0000 (13:34 +0200)
commitbd80d94efb83acd67d48f9f3f07483c8306085aa
tree5776fa204d2772616ca1f0fd083334314fe79a86
parent23d31bd476d1d096d0f073483547872ec155ab34
btrfs: Always use a cached extent_state in btrfs_lock_and_flush_ordered_range

In case no cached_state argument is passed to
btrfs_lock_and_flush_ordered_range use one locally in the function. This
optimises the case when an ordered extent is found since the unlock
function will be able to unlock that state directly without searching
for it again.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ordered-data.c