summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/log.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2023-08-17 15:46:16 +0200
committerAndreas Gruenbacher <agruenba@redhat.com>2023-09-05 15:58:16 +0200
commit6df373b09b1dcf2f7d579f515f653f89a896d417 (patch)
tree1c397853732bfec6dff2712bdc6433b1ca941c55 /fs/gfs2/log.c
parent66fa9912ec973796de4ce9b430d0811d401c17bb (diff)
downloadlinux-6df373b09b1dcf2f7d579f515f653f89a896d417.tar.gz
linux-6df373b09b1dcf2f7d579f515f653f89a896d417.tar.bz2
linux-6df373b09b1dcf2f7d579f515f653f89a896d417.zip
gfs2: Switch to wait_event in gfs2_logd
In gfs2_logd(), switch from an open-coded wait loop to wait_event_interruptible_timeout(). Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/log.c')
-rw-r--r--fs/gfs2/log.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index aa568796207c..d3da259820e3 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -1301,7 +1301,6 @@ int gfs2_logd(void *data)
{
struct gfs2_sbd *sdp = data;
unsigned long t = 1;
- DEFINE_WAIT(wait);
while (!kthread_should_stop()) {
@@ -1338,17 +1337,11 @@ int gfs2_logd(void *data)
try_to_freeze();
- do {
- prepare_to_wait(&sdp->sd_logd_waitq, &wait,
- TASK_INTERRUPTIBLE);
- if (!gfs2_ail_flush_reqd(sdp) &&
- !gfs2_jrnl_flush_reqd(sdp) &&
- !kthread_should_stop())
- t = schedule_timeout(t);
- } while(t && !gfs2_ail_flush_reqd(sdp) &&
- !gfs2_jrnl_flush_reqd(sdp) &&
- !kthread_should_stop());
- finish_wait(&sdp->sd_logd_waitq, &wait);
+ t = wait_event_interruptible_timeout(sdp->sd_logd_waitq,
+ gfs2_ail_flush_reqd(sdp) ||
+ gfs2_jrnl_flush_reqd(sdp) ||
+ kthread_should_stop(),
+ t);
}
return 0;