Skip to content

Commit 279b4db

Browse files
fdmananakdave
authored andcommitted
btrfs: use cached state when falling back from NOCoW write to CoW write
We have a cached extent state record from the previous extent locking so we can use when setting the EXTENT_NORESERVE in the range, allowing the operation to be faster if the extent io tree is relatively large. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent bfc9d71 commit 279b4db

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/btrfs/inode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,8 @@ static int fallback_to_cow(struct btrfs_inode *inode,
17541754
spin_unlock(&sinfo->lock);
17551755

17561756
if (count > 0)
1757-
btrfs_clear_extent_bits(io_tree, start, end, EXTENT_NORESERVE);
1757+
btrfs_clear_extent_bit(io_tree, start, end, EXTENT_NORESERVE,
1758+
&cached_state);
17581759
}
17591760
btrfs_unlock_extent(io_tree, start, end, &cached_state);
17601761

0 commit comments

Comments
 (0)