diff options
author | Filipe Manana <fdmanana@suse.com> | 2022-03-23 16:19:26 +0000 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-05-16 17:03:10 +0200 |
commit | 1a89f1738684cac05b4bbea80dd77e8f15176d3a (patch) | |
tree | 7ccdf8499a44a93d031e62034678253065189b0f /fs/btrfs/inode.c | |
parent | d7a8ab4e9b889de6daddbb674460e42b86d5dccf (diff) |
btrfs: stop allocating a path when checking if cross reference exists
At btrfs_cross_ref_exist() we always allocate a path, but we really don't
need to because all its callers (only 2) already have an allocated path
that is not being used when they call btrfs_cross_ref_exist(). So change
btrfs_cross_ref_exist() to take a path as an argument and update both
its callers to pass in the unused path they have when they call
btrfs_cross_ref_exist().
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 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 05cb7b1ab1727..ca47f7c43ee60 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1788,7 +1788,8 @@ next_slot: ret = btrfs_cross_ref_exist(root, ino, found_key.offset - - extent_offset, disk_bytenr, false); + extent_offset, disk_bytenr, + false, path); if (ret) { /* * ret could be -EIO if the above fails to read @@ -7222,7 +7223,7 @@ noinline int can_nocow_extent(struct inode *inode, u64 offset, u64 *len, ret = btrfs_cross_ref_exist(root, btrfs_ino(BTRFS_I(inode)), key.offset - backref_offset, disk_bytenr, - strict); + strict, path); if (ret) { ret = 0; goto out; |