Commit a9377422 authored by Lu Fengqi's avatar Lu Fengqi Committed by David Sterba

btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_inherit

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 280f8bd2
...@@ -601,7 +601,7 @@ static noinline int create_subvol(struct inode *dir, ...@@ -601,7 +601,7 @@ static noinline int create_subvol(struct inode *dir,
trans->block_rsv = &block_rsv; trans->block_rsv = &block_rsv;
trans->bytes_reserved = block_rsv.size; trans->bytes_reserved = block_rsv.size;
ret = btrfs_qgroup_inherit(trans, fs_info, 0, objectid, inherit); ret = btrfs_qgroup_inherit(trans, 0, objectid, inherit);
if (ret) if (ret)
goto fail; goto fail;
......
...@@ -2238,13 +2238,13 @@ int btrfs_run_qgroups(struct btrfs_trans_handle *trans) ...@@ -2238,13 +2238,13 @@ int btrfs_run_qgroups(struct btrfs_trans_handle *trans)
* cause a transaction abort so we take extra care here to only error * cause a transaction abort so we take extra care here to only error
* when a readonly fs is a reasonable outcome. * when a readonly fs is a reasonable outcome.
*/ */
int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, u64 srcid,
struct btrfs_fs_info *fs_info, u64 srcid, u64 objectid, u64 objectid, struct btrfs_qgroup_inherit *inherit)
struct btrfs_qgroup_inherit *inherit)
{ {
int ret = 0; int ret = 0;
int i; int i;
u64 *i_qgroups; u64 *i_qgroups;
struct btrfs_fs_info *fs_info = trans->fs_info;
struct btrfs_root *quota_root = fs_info->quota_root; struct btrfs_root *quota_root = fs_info->quota_root;
struct btrfs_qgroup *srcgroup; struct btrfs_qgroup *srcgroup;
struct btrfs_qgroup *dstgroup; struct btrfs_qgroup *dstgroup;
......
...@@ -241,9 +241,8 @@ int btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans, u64 bytenr, ...@@ -241,9 +241,8 @@ int btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans, u64 bytenr,
struct ulist *new_roots); struct ulist *new_roots);
int btrfs_qgroup_account_extents(struct btrfs_trans_handle *trans); int btrfs_qgroup_account_extents(struct btrfs_trans_handle *trans);
int btrfs_run_qgroups(struct btrfs_trans_handle *trans); int btrfs_run_qgroups(struct btrfs_trans_handle *trans);
int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, u64 srcid,
struct btrfs_fs_info *fs_info, u64 srcid, u64 objectid, u64 objectid, struct btrfs_qgroup_inherit *inherit);
struct btrfs_qgroup_inherit *inherit);
void btrfs_qgroup_free_refroot(struct btrfs_fs_info *fs_info, void btrfs_qgroup_free_refroot(struct btrfs_fs_info *fs_info,
u64 ref_root, u64 num_bytes, u64 ref_root, u64 num_bytes,
enum btrfs_qgroup_rsv_type type); enum btrfs_qgroup_rsv_type type);
......
...@@ -1355,8 +1355,7 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans, ...@@ -1355,8 +1355,7 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans,
goto out; goto out;
/* Now qgroup are all updated, we can inherit it to new qgroups */ /* Now qgroup are all updated, we can inherit it to new qgroups */
ret = btrfs_qgroup_inherit(trans, fs_info, ret = btrfs_qgroup_inherit(trans, src->root_key.objectid, dst_objectid,
src->root_key.objectid, dst_objectid,
inherit); inherit);
if (ret < 0) if (ret < 0)
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