From: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Subject: [PATCH 1/6] btrfs: delayed-ref: pass delayed_refs directly to btrfs_select_ref_head()
Date: Thu, 11 Oct 2018 13:40:33 +0800 [thread overview]
Message-ID: <20181011054038.5428-2-lufq.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <20181011054038.5428-1-lufq.fnst@cn.fujitsu.com>
Since trans is only used for referring to delayed_refs, there is no need
to pass it instead of delayed_refs to btrfs_select_ref_head().
No functional change.
Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
---
fs/btrfs/delayed-ref.c | 5 +----
fs/btrfs/delayed-ref.h | 2 +-
fs/btrfs/extent-tree.c | 2 +-
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
index 7f567c944fec..13ae86252c4c 100644
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -354,15 +354,12 @@ int btrfs_check_delayed_seq(struct btrfs_fs_info *fs_info, u64 seq)
}
struct btrfs_delayed_ref_head *
-btrfs_select_ref_head(struct btrfs_trans_handle *trans)
+btrfs_select_ref_head(struct btrfs_delayed_ref_root *delayed_refs)
{
- struct btrfs_delayed_ref_root *delayed_refs;
struct btrfs_delayed_ref_head *head;
u64 start;
bool loop = false;
- delayed_refs = &trans->transaction->delayed_refs;
-
again:
start = delayed_refs->run_delayed_start;
head = find_ref_head(delayed_refs, start, 1);
diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs/delayed-ref.h
index c3e3486a126c..aa66ad6919ab 100644
--- a/fs/btrfs/delayed-ref.h
+++ b/fs/btrfs/delayed-ref.h
@@ -264,7 +264,7 @@ static inline void btrfs_delayed_ref_unlock(struct btrfs_delayed_ref_head *head)
struct btrfs_delayed_ref_head *
-btrfs_select_ref_head(struct btrfs_trans_handle *trans);
+btrfs_select_ref_head(struct btrfs_delayed_ref_root *delayed_refs);
int btrfs_check_delayed_seq(struct btrfs_fs_info *fs_info, u64 seq);
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 22b9269ae84c..22acc1545147 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2511,7 +2511,7 @@ static struct btrfs_delayed_ref_head *btrfs_obtain_ref_head(
int ret;
spin_lock(&delayed_refs->lock);
- head = btrfs_select_ref_head(trans);
+ head = btrfs_select_ref_head(delayed_refs);
if (!head) {
spin_unlock(&delayed_refs->lock);
return head;
--
2.19.1
next prev parent reply other threads:[~2018-10-11 5:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-11 5:40 [PATCH 0/6] Some trivail cleanup about dealyed-refs Lu Fengqi
2018-10-11 5:40 ` Lu Fengqi [this message]
2018-10-11 5:40 ` [PATCH 2/6] btrfs: delayed-ref: pass delayed_refs directly to btrfs_delayed_ref_lock() Lu Fengqi
2018-10-11 5:40 ` [PATCH 3/6] btrfs: remove fs_info from btrfs_check_space_for_delayed_refs Lu Fengqi
2018-10-11 5:40 ` [PATCH 4/6] btrfs: remove fs_info from btrfs_should_throttle_delayed_refs Lu Fengqi
2018-10-11 5:40 ` [PATCH 5/6] btrfs: simplify btrfs_select_ref_head and cleanup some local variables Lu Fengqi
2018-10-11 6:40 ` Nikolay Borisov
2018-10-11 12:15 ` Lu Fengqi
2018-10-11 12:28 ` Nikolay Borisov
2018-10-11 12:45 ` David Sterba
2018-10-15 2:32 ` Lu Fengqi
2018-10-15 2:09 ` Lu Fengqi
2018-10-11 5:40 ` [PATCH 6/6] btrfs: switch return_bigger to bool in find_ref_head Lu Fengqi
2018-10-11 6:41 ` [PATCH 0/6] Some trivail cleanup about dealyed-refs Nikolay Borisov
2018-10-11 11:51 ` David Sterba
2018-10-15 2:39 ` Lu Fengqi
2018-10-15 13:26 ` 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=20181011054038.5428-2-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;
as well as URLs for NNTP newsgroup(s).