diff options
author | Nikolay Borisov <nborisov@suse.com> | 2019-05-07 09:19:23 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-07-01 13:34:59 +0200 |
commit | 23d31bd476d1d096d0f073483547872ec155ab34 (patch) | |
tree | 8b87d3dc9118dce18703a7594775023f54383f6f /fs/btrfs/inode.c | |
parent | btrfs: add new helper btrfs_lock_and_flush_ordered_range (diff) | |
download | linux-23d31bd476d1d096d0f073483547872ec155ab34.tar.xz linux-23d31bd476d1d096d0f073483547872ec155ab34.zip |
btrfs: Use newly introduced btrfs_lock_and_flush_ordered_range
There several functions which open code
btrfs_lock_and_flush_ordered_range, just replace them with a call to the
function. No functional changes.
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>
Diffstat (limited to '')
-rw-r--r-- | fs/btrfs/inode.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d324e2a06240..9137bafc9376 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5004,21 +5004,8 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size) if (size <= hole_start) return 0; - while (1) { - struct btrfs_ordered_extent *ordered; - - lock_extent_bits(io_tree, hole_start, block_end - 1, - &cached_state); - ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), hole_start, - block_end - hole_start); - if (!ordered) - break; - unlock_extent_cached(io_tree, hole_start, block_end - 1, - &cached_state); - btrfs_start_ordered_extent(inode, ordered, 1); - btrfs_put_ordered_extent(ordered); - } - + btrfs_lock_and_flush_ordered_range(io_tree, BTRFS_I(inode), hole_start, + block_end - 1, &cached_state); cur_offset = hole_start; while (1) { em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, cur_offset, |