Skip to content

Commit b343047

Browse files
fdmananakdave
authored andcommitted
btrfs: avoid path allocations when dropping extents during log replay
We can avoid a path allocation in the btrfs_drop_extents() calls we have at replay_one_extent() and replay_one_buffer() by passing the path we already have in those contextes as it's unused by the time they call btrfs_drop_extents(). 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 29d9c5e commit b343047

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/btrfs/tree-log.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,7 @@ static noinline int replay_one_extent(struct walk_control *wc, struct btrfs_path
738738
drop_args.start = start;
739739
drop_args.end = extent_end;
740740
drop_args.drop_cache = true;
741+
drop_args.path = path;
741742
ret = btrfs_drop_extents(trans, root, inode, &drop_args);
742743
if (ret) {
743744
btrfs_abort_transaction(trans, ret);
@@ -2676,6 +2677,7 @@ static int replay_one_buffer(struct extent_buffer *eb,
26762677
drop_args.start = from;
26772678
drop_args.end = (u64)-1;
26782679
drop_args.drop_cache = true;
2680+
drop_args.path = path;
26792681
ret = btrfs_drop_extents(trans, root, inode, &drop_args);
26802682
if (ret) {
26812683
btrfs_abort_transaction(trans, ret);

0 commit comments

Comments
 (0)