Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Subject: [PATCH 16/19] btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_account_extent
Date: Wed, 18 Jul 2018 14:45:39 +0800	[thread overview]
Message-ID: <20180718064542.2730-17-lufq.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <20180718064542.2730-1-lufq.fnst@cn.fujitsu.com>

It can be fetched from the transaction handle.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
---
 fs/btrfs/qgroup.c             | 20 ++++++++++----------
 fs/btrfs/qgroup.h             |  8 +++-----
 fs/btrfs/tests/qgroup-tests.c | 20 ++++++++++----------
 3 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 92d757e3a2f5..c0b684f279cf 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -2039,12 +2039,11 @@ static int maybe_fs_roots(struct ulist *roots)
 	return is_fstree(unode->val);
 }
 
-int
-btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans,
-			    struct btrfs_fs_info *fs_info,
-			    u64 bytenr, u64 num_bytes,
-			    struct ulist *old_roots, struct ulist *new_roots)
+int btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans, u64 bytenr,
+				u64 num_bytes, struct ulist *old_roots,
+				struct ulist *new_roots)
 {
+	struct btrfs_fs_info *fs_info = trans->fs_info;
 	struct ulist *qgroups = NULL;
 	struct ulist *tmp = NULL;
 	u64 seq;
@@ -2174,9 +2173,10 @@ int btrfs_qgroup_account_extents(struct btrfs_trans_handle *trans)
 				ulist_del(record->old_roots, qgroup_to_skip,
 					  0);
 			}
-			ret = btrfs_qgroup_account_extent(trans, fs_info,
-					record->bytenr, record->num_bytes,
-					record->old_roots, new_roots);
+			ret = btrfs_qgroup_account_extent(trans, record->bytenr,
+							  record->num_bytes,
+							  record->old_roots,
+							  new_roots);
 			record->old_roots = NULL;
 			new_roots = NULL;
 		}
@@ -2712,8 +2712,8 @@ qgroup_rescan_leaf(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
 		if (ret < 0)
 			goto out;
 		/* For rescan, just pass old_roots as NULL */
-		ret = btrfs_qgroup_account_extent(trans, fs_info,
-				found.objectid, num_bytes, NULL, roots);
+		ret = btrfs_qgroup_account_extent(trans, found.objectid,
+						  num_bytes, NULL, roots);
 		if (ret < 0)
 			goto out;
 	}
diff --git a/fs/btrfs/qgroup.h b/fs/btrfs/qgroup.h
index b8f15ce6c83d..61b723b1e4d8 100644
--- a/fs/btrfs/qgroup.h
+++ b/fs/btrfs/qgroup.h
@@ -236,11 +236,9 @@ int btrfs_qgroup_trace_leaf_items(struct btrfs_trans_handle *trans,
 int btrfs_qgroup_trace_subtree(struct btrfs_trans_handle *trans,
 			       struct extent_buffer *root_eb,
 			       u64 root_gen, int root_level);
-int
-btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans,
-			    struct btrfs_fs_info *fs_info,
-			    u64 bytenr, u64 num_bytes,
-			    struct ulist *old_roots, struct ulist *new_roots);
+int btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans, u64 bytenr,
+				u64 num_bytes, struct ulist *old_roots,
+				struct ulist *new_roots);
 int btrfs_qgroup_account_extents(struct btrfs_trans_handle *trans);
 int btrfs_run_qgroups(struct btrfs_trans_handle *trans,
 		      struct btrfs_fs_info *fs_info);
diff --git a/fs/btrfs/tests/qgroup-tests.c b/fs/btrfs/tests/qgroup-tests.c
index b5e332d45d37..412b910b04cc 100644
--- a/fs/btrfs/tests/qgroup-tests.c
+++ b/fs/btrfs/tests/qgroup-tests.c
@@ -249,8 +249,8 @@ static int test_no_shared_qgroup(struct btrfs_root *root,
 		return ret;
 	}
 
-	ret = btrfs_qgroup_account_extent(&trans, fs_info, nodesize,
-					  nodesize, old_roots, new_roots);
+	ret = btrfs_qgroup_account_extent(&trans, nodesize, nodesize, old_roots,
+					  new_roots);
 	if (ret) {
 		test_err("couldn't account space for a qgroup %d", ret);
 		return ret;
@@ -285,8 +285,8 @@ static int test_no_shared_qgroup(struct btrfs_root *root,
 		return ret;
 	}
 
-	ret = btrfs_qgroup_account_extent(&trans, fs_info, nodesize,
-					  nodesize, old_roots, new_roots);
+	ret = btrfs_qgroup_account_extent(&trans, nodesize, nodesize, old_roots,
+					  new_roots);
 	if (ret) {
 		test_err("couldn't account space for a qgroup %d", ret);
 		return -EINVAL;
@@ -350,8 +350,8 @@ static int test_multiple_refs(struct btrfs_root *root,
 		return ret;
 	}
 
-	ret = btrfs_qgroup_account_extent(&trans, fs_info, nodesize,
-					  nodesize, old_roots, new_roots);
+	ret = btrfs_qgroup_account_extent(&trans, nodesize, nodesize, old_roots,
+					  new_roots);
 	if (ret) {
 		test_err("couldn't account space for a qgroup %d", ret);
 		return ret;
@@ -385,8 +385,8 @@ static int test_multiple_refs(struct btrfs_root *root,
 		return ret;
 	}
 
-	ret = btrfs_qgroup_account_extent(&trans, fs_info, nodesize,
-					  nodesize, old_roots, new_roots);
+	ret = btrfs_qgroup_account_extent(&trans, nodesize, nodesize, old_roots,
+					  new_roots);
 	if (ret) {
 		test_err("couldn't account space for a qgroup %d", ret);
 		return ret;
@@ -426,8 +426,8 @@ static int test_multiple_refs(struct btrfs_root *root,
 		return ret;
 	}
 
-	ret = btrfs_qgroup_account_extent(&trans, fs_info, nodesize,
-					  nodesize, old_roots, new_roots);
+	ret = btrfs_qgroup_account_extent(&trans, nodesize, nodesize, old_roots,
+					  new_roots);
 	if (ret) {
 		test_err("couldn't account space for a qgroup %d", ret);
 		return ret;
-- 
2.18.0




  parent reply	other threads:[~2018-07-18  7:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-18  6:45 [PATCH 00/19] qgroup unused parameter cleanup Lu Fengqi
2018-07-18  6:45 ` [PATCH 01/19] btrfs: qgroup: Drop quota_root parameter from add_qgroup_relation_item Lu Fengqi
2018-07-18  6:45 ` [PATCH 02/19] btrfs: qgroup: Drop quota_root parameter from del_qgroup_relation_item Lu Fengqi
2018-07-18  6:45 ` [PATCH 03/19] btrfs: qgroup: Drop quota_root parameter from del_qgroup_item Lu Fengqi
2018-07-18  6:45 ` [PATCH 04/19] btrfs: qgroup: Drop root parameter from update_qgroup_limit_item Lu Fengqi
2018-07-18  6:45 ` [PATCH 05/19] btrfs: qgroup: Drop root parameter from update_qgroup_info_item Lu Fengqi
2018-07-18  6:45 ` [PATCH 06/19] btrfs: qgroup: Drop quota_root and fs_info parameters from update_qgroup_status_item Lu Fengqi
2018-07-18  6:45 ` [PATCH 07/19] btrfs: qgroup: Drop fs_info parameter from btrfs_add_qgroup_relation Lu Fengqi
2018-07-18  6:45 ` [PATCH 08/19] btrfs: qgroup: Drop fs_info parameter from __del_qgroup_relation Lu Fengqi
2018-07-18  6:45 ` [PATCH 09/19] btrfs: qgroup: Drop fs_info parameter from btrfs_del_qgroup_relation Lu Fengqi
2018-07-18  6:45 ` [PATCH 10/19] btrfs: qgroup: Drop fs_info parameter from btrfs_create_qgroup Lu Fengqi
2018-07-18  6:45 ` [PATCH 11/19] btrfs: qgroup: Drop fs_info parameter from btrfs_remove_qgroup Lu Fengqi
2018-07-18  6:45 ` [PATCH 12/19] btrfs: qgroup: Drop fs_info parameter from btrfs_limit_qgroup Lu Fengqi
2018-07-18  6:45 ` [PATCH 13/19] btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_trace_extent Lu Fengqi
2018-07-18  6:58   ` Qu Wenruo
2018-07-18  7:54     ` Lu Fengqi
2018-07-18  8:02       ` Qu Wenruo
2018-07-18  8:28   ` [PATCH v2 " Lu Fengqi
2018-07-18  6:45 ` [PATCH 14/19] btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_trace_leaf_items Lu Fengqi
2018-07-18  6:45 ` [PATCH 15/19] btrfs: qgroup: Drop root parameter from btrfs_qgroup_trace_subtree Lu Fengqi
2018-07-18  6:45 ` Lu Fengqi [this message]
2018-07-18  6:45 ` [PATCH 17/19] btrfs: qgroup: Drop fs_info parameter from btrfs_run_qgroups Lu Fengqi
2018-07-18  6:45 ` [PATCH 18/19] btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_inherit Lu Fengqi
2018-07-18  6:45 ` [PATCH 19/19] btrfs: qgroup: Drop fs_info parameter from qgroup_rescan_leaf Lu Fengqi
2018-07-18  7:00 ` [PATCH 00/19] qgroup unused parameter cleanup Qu Wenruo
2018-07-18 13:36 ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180718064542.2730-17-lufq.fnst@cn.fujitsu.com \
    --to=lufq.fnst@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox