summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2022-03-23 16:19:28 +0000
committerDavid Sterba <dsterba@suse.com>2022-05-16 17:03:10 +0200
commit59d35c5171e65f3a208b6f44d028278f129bdeab (patch)
tree31173ad619bec7d648d47de94bf0fb6fa55d0256 /mm
parentc1a548db25c3bafed0b8519cf2f41c6e44bc5dc4 (diff)
btrfs: release path earlier at can_nocow_extent()
At can_nocow_extent(), we are releasing the path only after checking if the block group that has the target extent is read only, and after checking if there's delalloc in the range in case our extent is a preallocated extent. The read only extent check can be expensive if we have a very large filesystem with many block groups, as well as the check for delalloc in the inode's io_tree in case the io_tree is big due to IO on other file ranges. Our path is holding a read lock on a leaf and there's no need to keep the lock while doing those two checks, so release the path before doing them, immediately after the last use of the leaf. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions