mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ChenXiaoSong <chenxiaosong2@huawei.com>
To: <rpeterso@redhat.com>, <agruenba@redhat.com>
Cc: <cluster-devel@redhat.com>, <linux-kernel@vger.kernel.org>,
	<chenxiaosong2@huawei.com>
Subject: [PATCH 1/2] gfs2: factor out __gfs2_ail1_empty() and gfs2_ail1_withdraw()
Date: Mon, 6 Feb 2023 17:55:42 +0800	[thread overview]
Message-ID: <20230206095543.539186-2-chenxiaosong2@huawei.com> (raw)
In-Reply-To: <20230206095543.539186-1-chenxiaosong2@huawei.com>

Factor out __gfs2_ail1_empty() and gfs2_ail1_withdraw() from
gfs2_ail1_empty(). No functional change.

Signed-off-by: ChenXiaoSong <chenxiaosong2@huawei.com>
---
 fs/gfs2/log.c | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 61323deb80bc..c62c914702ba 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -347,15 +347,7 @@ static int gfs2_ail1_empty_one(struct gfs2_sbd *sdp, struct gfs2_trans *tr,
 	return active_count;
 }
 
-/**
- * gfs2_ail1_empty - Try to empty the ail1 lists
- * @sdp: The superblock
- * @max_revokes: If non-zero, add revokes where appropriate
- *
- * Tries to empty the ail1 lists, starting with the oldest first
- */
-
-static int gfs2_ail1_empty(struct gfs2_sbd *sdp, int max_revokes)
+static int __gfs2_ail1_empty(struct gfs2_sbd *sdp, int max_revokes)
 {
 	struct gfs2_trans *tr, *s;
 	int oldest_tr = 1;
@@ -372,10 +364,31 @@ static int gfs2_ail1_empty(struct gfs2_sbd *sdp, int max_revokes)
 	ret = list_empty(&sdp->sd_ail1_list);
 	spin_unlock(&sdp->sd_ail_lock);
 
+	return ret;
+}
+
+static void gfs2_ail1_withdraw(struct gfs2_sbd *sdp)
+{
 	if (test_bit(SDF_WITHDRAWING, &sdp->sd_flags)) {
 		gfs2_lm(sdp, "fatal: I/O error(s)\n");
 		gfs2_withdraw(sdp);
 	}
+}
+
+/**
+ * gfs2_ail1_empty - Try to empty the ail1 lists
+ * @sdp: The superblock
+ * @max_revokes: If non-zero, add revokes where appropriate
+ *
+ * Tries to empty the ail1 lists, starting with the oldest first
+ */
+
+static int gfs2_ail1_empty(struct gfs2_sbd *sdp, int max_revokes)
+{
+	int ret;
+
+	ret = __gfs2_ail1_empty(sdp, max_revokes);
+	gfs2_ail1_withdraw(sdp);
 
 	return ret;
 }
-- 
2.31.1


  reply	other threads:[~2023-02-06  8:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06  9:55 [PATCH 0/2] gfs2: fix sleep from invalid context bug in gfs2_glock_wait() ChenXiaoSong
2023-02-06  9:55 ` ChenXiaoSong [this message]
2023-02-06  9:55 ` [PATCH 2/2] " ChenXiaoSong

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=20230206095543.539186-2-chenxiaosong2@huawei.com \
    --to=chenxiaosong2@huawei.com \
    --cc=agruenba@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpeterso@redhat.com \
    /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

all inboxes | Powered by JetHome®