aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs
diff options
context:
space:
mode:
authorJosef Bacik2024-02-12 16:59:43 -0500
committerDavid Sterba2024-05-07 21:31:09 +0200
commit0e128d4e41735b37d9450b4e622b427189afb191 (patch)
tree5f3fe512db31192edf459160563ec89ed193b0a9 /fs/btrfs
parentaa56b0aa91692c51142c3c7e4ab7665e84f792f5 (diff)
btrfs: remove unlock_extent from run_delalloc_compressed
Since we immediately unlock the extent range when we enter run_delalloc_compressed() simply move the lock_extent() down to cover cow_file_range() and then remove the unlock_extent() from run_delalloc_compressed. Reviewed-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/inode.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 7c4ebe061abb..5337b54148e3 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1642,7 +1642,6 @@ static bool run_delalloc_compressed(struct btrfs_inode *inode,
if (!ctx)
return false;
- unlock_extent(&inode->io_tree, start, end, NULL);
set_bit(BTRFS_INODE_HAS_ASYNC_EXTENT, &inode->runtime_flags);
async_chunk = ctx->chunks;
@@ -2276,16 +2275,16 @@ int btrfs_run_delalloc_range(struct btrfs_inode *inode, struct page *locked_page
goto out;
}
- /*
- * We're unlocked by the different fill functions below.
- */
- lock_extent(&inode->io_tree, start, end, NULL);
-
if (btrfs_inode_can_compress(inode) &&
inode_need_compress(inode, start, end) &&
run_delalloc_compressed(inode, locked_page, start, end, wbc))
return 1;
+ /*
+ * We're unlocked by the different fill functions below.
+ */
+ lock_extent(&inode->io_tree, start, end, NULL);
+
if (zoned)
ret = run_delalloc_cow(inode, locked_page, start, end, wbc,
true);