Commit 711169c4 authored by Lu Fengqi's avatar Lu Fengqi Committed by David Sterba

btrfs: qgroup: Drop quota_root parameter from add_qgroup_relation_item

It can be fetched from the transaction handle.
Signed-off-by: default avatarLu Fengqi <lufq.fnst@cn.fujitsu.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent fa59f27c
...@@ -530,11 +530,11 @@ void btrfs_free_qgroup_config(struct btrfs_fs_info *fs_info) ...@@ -530,11 +530,11 @@ void btrfs_free_qgroup_config(struct btrfs_fs_info *fs_info)
fs_info->qgroup_ulist = NULL; fs_info->qgroup_ulist = NULL;
} }
static int add_qgroup_relation_item(struct btrfs_trans_handle *trans, static int add_qgroup_relation_item(struct btrfs_trans_handle *trans, u64 src,
struct btrfs_root *quota_root, u64 dst)
u64 src, u64 dst)
{ {
int ret; int ret;
struct btrfs_root *quota_root = trans->fs_info->quota_root;
struct btrfs_path *path; struct btrfs_path *path;
struct btrfs_key key; struct btrfs_key key;
...@@ -1274,11 +1274,11 @@ int btrfs_add_qgroup_relation(struct btrfs_trans_handle *trans, ...@@ -1274,11 +1274,11 @@ int btrfs_add_qgroup_relation(struct btrfs_trans_handle *trans,
} }
} }
ret = add_qgroup_relation_item(trans, quota_root, src, dst); ret = add_qgroup_relation_item(trans, src, dst);
if (ret) if (ret)
goto out; goto out;
ret = add_qgroup_relation_item(trans, quota_root, dst, src); ret = add_qgroup_relation_item(trans, dst, src);
if (ret) { if (ret) {
del_qgroup_relation_item(trans, quota_root, src, dst); del_qgroup_relation_item(trans, quota_root, src, dst);
goto out; goto out;
...@@ -2295,12 +2295,12 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, ...@@ -2295,12 +2295,12 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans,
for (i = 0; i < inherit->num_qgroups; ++i, ++i_qgroups) { for (i = 0; i < inherit->num_qgroups; ++i, ++i_qgroups) {
if (*i_qgroups == 0) if (*i_qgroups == 0)
continue; continue;
ret = add_qgroup_relation_item(trans, quota_root, ret = add_qgroup_relation_item(trans, objectid,
objectid, *i_qgroups); *i_qgroups);
if (ret && ret != -EEXIST) if (ret && ret != -EEXIST)
goto out; goto out;
ret = add_qgroup_relation_item(trans, quota_root, ret = add_qgroup_relation_item(trans, *i_qgroups,
*i_qgroups, objectid); objectid);
if (ret && ret != -EEXIST) if (ret && ret != -EEXIST)
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment