summaryrefslogtreecommitdiff
path: root/fs/btrfs/props.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-11-09 10:12:07 -0500
committerDavid Sterba <dsterba@suse.com>2022-01-03 15:09:45 +0100
commit9270501c163b67f48fd5fb2f98b1b48d6530f460 (patch)
treedd51bafe37ebb37747c3f6ce0fb718ee0507f05f /fs/btrfs/props.c
parent54230013d41fb6eb231755dfec8615db9dcfb020 (diff)
btrfs: change root to fs_info for btrfs_reserve_metadata_bytes
We used to need the root for btrfs_reserve_metadata_bytes to check the orphan cleanup state, but we no longer need that, we simply need the fs_info. Change btrfs_reserve_metadata_bytes() to use the fs_info, and change both btrfs_block_rsv_refill() and btrfs_block_rsv_add() to do the same as they simply call btrfs_reserve_metadata_bytes() and then manipulate the block_rsv that is being used. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/props.c')
-rw-r--r--fs/btrfs/props.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/props.c b/fs/btrfs/props.c
index a978676aa627..1a6d2d5b4b33 100644
--- a/fs/btrfs/props.c
+++ b/fs/btrfs/props.c
@@ -377,8 +377,9 @@ static int inherit_props(struct btrfs_trans_handle *trans,
*/
if (need_reserve) {
num_bytes = btrfs_calc_insert_metadata_size(fs_info, 1);
- ret = btrfs_block_rsv_add(root, trans->block_rsv,
- num_bytes, BTRFS_RESERVE_NO_FLUSH);
+ ret = btrfs_block_rsv_add(fs_info, trans->block_rsv,
+ num_bytes,
+ BTRFS_RESERVE_NO_FLUSH);
if (ret)
return ret;
}