btrfs: take an fs_info directly when the root is not used otherwise
There are loads of functions in btrfs that accept a root parameter but only use it to obtain an fs_info pointer. Let's convert those to just accept an fs_info pointer directly. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:

committed by
David Sterba

parent
afdb571890
commit
2ff7e61e0d
@@ -301,6 +301,7 @@ static int inherit_props(struct btrfs_trans_handle *trans,
|
||||
struct inode *parent)
|
||||
{
|
||||
struct btrfs_root *root = BTRFS_I(inode)->root;
|
||||
struct btrfs_fs_info *fs_info = root->fs_info;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
@@ -320,14 +321,14 @@ static int inherit_props(struct btrfs_trans_handle *trans,
|
||||
if (!value)
|
||||
continue;
|
||||
|
||||
num_bytes = btrfs_calc_trans_metadata_size(root->fs_info, 1);
|
||||
num_bytes = btrfs_calc_trans_metadata_size(fs_info, 1);
|
||||
ret = btrfs_block_rsv_add(root, trans->block_rsv,
|
||||
num_bytes, BTRFS_RESERVE_NO_FLUSH);
|
||||
if (ret)
|
||||
goto out;
|
||||
ret = __btrfs_set_prop(trans, inode, h->xattr_name,
|
||||
value, strlen(value), 0);
|
||||
btrfs_block_rsv_release(root, trans->block_rsv, num_bytes);
|
||||
btrfs_block_rsv_release(fs_info, trans->block_rsv, num_bytes);
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
|
Reference in New Issue
Block a user