Commit 0e128d4e authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

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: default avatarGoldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent aa56b0aa
...@@ -1642,7 +1642,6 @@ static bool run_delalloc_compressed(struct btrfs_inode *inode, ...@@ -1642,7 +1642,6 @@ static bool run_delalloc_compressed(struct btrfs_inode *inode,
if (!ctx) if (!ctx)
return false; return false;
unlock_extent(&inode->io_tree, start, end, NULL);
set_bit(BTRFS_INODE_HAS_ASYNC_EXTENT, &inode->runtime_flags); set_bit(BTRFS_INODE_HAS_ASYNC_EXTENT, &inode->runtime_flags);
async_chunk = ctx->chunks; async_chunk = ctx->chunks;
...@@ -2276,16 +2275,16 @@ int btrfs_run_delalloc_range(struct btrfs_inode *inode, struct page *locked_page ...@@ -2276,16 +2275,16 @@ int btrfs_run_delalloc_range(struct btrfs_inode *inode, struct page *locked_page
goto out; 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) && if (btrfs_inode_can_compress(inode) &&
inode_need_compress(inode, start, end) && inode_need_compress(inode, start, end) &&
run_delalloc_compressed(inode, locked_page, start, end, wbc)) run_delalloc_compressed(inode, locked_page, start, end, wbc))
return 1; return 1;
/*
* We're unlocked by the different fill functions below.
*/
lock_extent(&inode->io_tree, start, end, NULL);
if (zoned) if (zoned)
ret = run_delalloc_cow(inode, locked_page, start, end, wbc, ret = run_delalloc_cow(inode, locked_page, start, end, wbc,
true); true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment