Skip to content

Commit 0e128d4

Browse files
josefbacikkdave
authored andcommitted
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>
1 parent aa56b0a commit 0e128d4

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

fs/btrfs/inode.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,7 +1642,6 @@ static bool run_delalloc_compressed(struct btrfs_inode *inode,
16421642
if (!ctx)
16431643
return false;
16441644

1645-
unlock_extent(&inode->io_tree, start, end, NULL);
16461645
set_bit(BTRFS_INODE_HAS_ASYNC_EXTENT, &inode->runtime_flags);
16471646

16481647
async_chunk = ctx->chunks;
@@ -2276,16 +2275,16 @@ int btrfs_run_delalloc_range(struct btrfs_inode *inode, struct page *locked_page
22762275
goto out;
22772276
}
22782277

2279-
/*
2280-
* We're unlocked by the different fill functions below.
2281-
*/
2282-
lock_extent(&inode->io_tree, start, end, NULL);
2283-
22842278
if (btrfs_inode_can_compress(inode) &&
22852279
inode_need_compress(inode, start, end) &&
22862280
run_delalloc_compressed(inode, locked_page, start, end, wbc))
22872281
return 1;
22882282

2283+
/*
2284+
* We're unlocked by the different fill functions below.
2285+
*/
2286+
lock_extent(&inode->io_tree, start, end, NULL);
2287+
22892288
if (zoned)
22902289
ret = run_delalloc_cow(inode, locked_page, start, end, wbc,
22912290
true);

0 commit comments

Comments
 (0)