btrfs: add new helper btrfs_lock_and_flush_ordered_range
authorNikolay Borisov <nborisov@suse.com>
Tue, 7 May 2019 07:19:22 +0000 (10:19 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 1 Jul 2019 11:34:59 +0000 (13:34 +0200)
commitffa87214c1100c7ea38e85a3cf981d0d47b1c744
tree6f8e12740a03383376cb4321fef14eeeeb3034e6
parent1200b51f57dca934cfd78969f460d636ec0fb838
btrfs: add new helper btrfs_lock_and_flush_ordered_range

There is a certain idiom used in multiple places in btrfs' codebase,
dealing with flushing an ordered range. Factor this in a separate
function that can be reused. Future patches will replace the existing
code with that function.

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
fs/btrfs/ordered-data.h