btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_inherit
authorLu Fengqi <lufq.fnst@cn.fujitsu.com>
Wed, 18 Jul 2018 06:45:41 +0000 (14:45 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:53 +0000 (13:12 +0200)
It can be fetched from the transaction handle.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c
fs/btrfs/qgroup.c
fs/btrfs/qgroup.h
fs/btrfs/transaction.c

index d0096383ac3dd1b5c3e0db797c84ee638403bb9c..4482cf35522e9304b78fcb668b73b9b4fa534bd0 100644 (file)
@@ -601,7 +601,7 @@ static noinline int create_subvol(struct inode *dir,
        trans->block_rsv = &block_rsv;
        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)
                goto fail;
 
index 819cdaea51ab3bae3fd20d53eafbd261ee2d88f1..96640c56c9105c827fc5a6d0cb5beeaf32e8b8b6 100644 (file)
@@ -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
  * when a readonly fs is a reasonable outcome.
  */
-int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans,
-                        struct btrfs_fs_info *fs_info, u64 srcid, u64 objectid,
-                        struct btrfs_qgroup_inherit *inherit)
+int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, u64 srcid,
+                        u64 objectid, struct btrfs_qgroup_inherit *inherit)
 {
        int ret = 0;
        int i;
        u64 *i_qgroups;
+       struct btrfs_fs_info *fs_info = trans->fs_info;
        struct btrfs_root *quota_root = fs_info->quota_root;
        struct btrfs_qgroup *srcgroup;
        struct btrfs_qgroup *dstgroup;
index 2c8960f9028cd4290377d1e2bbd846b1ecaa77fa..54b8bb282c0e0a30f3f3efe1ed3fc970641a7d96 100644 (file)
@@ -241,9 +241,8 @@ int btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans, u64 bytenr,
                                struct ulist *new_roots);
 int btrfs_qgroup_account_extents(struct btrfs_trans_handle *trans);
 int btrfs_run_qgroups(struct btrfs_trans_handle *trans);
-int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans,
-                        struct btrfs_fs_info *fs_info, u64 srcid, u64 objectid,
-                        struct btrfs_qgroup_inherit *inherit);
+int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, u64 srcid,
+                        u64 objectid, struct btrfs_qgroup_inherit *inherit);
 void btrfs_qgroup_free_refroot(struct btrfs_fs_info *fs_info,
                               u64 ref_root, u64 num_bytes,
                               enum btrfs_qgroup_rsv_type type);
index 0cbd55c498a198f6eddb8feafcf2f42b1bfa98f7..aec208cbff0034e874f713327d8aff48a5ccc142 100644 (file)
@@ -1355,8 +1355,7 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans,
                goto out;
 
        /* Now qgroup are all updated, we can inherit it to new qgroups */
-       ret = btrfs_qgroup_inherit(trans, fs_info,
-                                  src->root_key.objectid, dst_objectid,
+       ret = btrfs_qgroup_inherit(trans, src->root_key.objectid, dst_objectid,
                                   inherit);
        if (ret < 0)
                goto out;