]> git.ipfire.org Git - thirdparty/linux.git/commit
btrfs: reuse cloned extent buffer during fiemap to avoid re-allocations
authorFilipe Manana <fdmanana@suse.com>
Wed, 28 Feb 2024 14:36:33 +0000 (14:36 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 5 Mar 2024 17:14:19 +0000 (18:14 +0100)
commit1cab1375ba6d5337a25acb346996106c12bb2dd0
tree74882dd6bcf9a2fe6f3d0eeb1fdccf27d8fb57fc
parent978b63f7464abcfd364a6c95f734282c50f3decf
btrfs: reuse cloned extent buffer during fiemap to avoid re-allocations

During fiemap we may have to visit multiple leaves of the subvolume's
inode tree, and each time we are freeing and allocating an extent buffer
to use as a clone of each visited leaf. Optimize this by reusing cloned
extent buffers, to avoid the freeing and re-allocation both of the extent
buffer structure itself and more importantly of the pages attached to the
extent buffer.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c