summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/log.c
diff options
context:
space:
mode:
authorKevin Hao <haokexin@gmail.com>2023-12-18 13:35:58 +0800
committerAndreas Gruenbacher <agruenba@redhat.com>2023-12-21 22:53:46 +0100
commitedd13270fa0660fda608b5f2bf989c770d90d469 (patch)
tree825538b4681c2831414a9d16738d693c939986ca /fs/gfs2/log.c
parent76e7211ca129f6a9117ae88c020a4c1cafaa24cc (diff)
downloadlinux-edd13270fa0660fda608b5f2bf989c770d90d469.tar.gz
linux-edd13270fa0660fda608b5f2bf989c770d90d469.tar.bz2
linux-edd13270fa0660fda608b5f2bf989c770d90d469.zip
gfs2: Use wait_event_freezable_timeout() for freezable kthread
A freezable kernel thread can enter frozen state during freezing by either calling try_to_freeze() or using wait_event_freezable() and its variants. So for the following snippet of code in a kernel thread loop: try_to_freeze(); wait_event_interruptible_timeout(); We can change it to a simple wait_event_freezable_timeout() and then eliminate a function call. Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/log.c')
-rw-r--r--fs/gfs2/log.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 860176989751..6b3ba8f7b67a 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -1337,9 +1337,7 @@ int gfs2_logd(void *data)
t = gfs2_tune_get(sdp, gt_logd_secs) * HZ;
- try_to_freeze();
-
- t = wait_event_interruptible_timeout(sdp->sd_logd_waitq,
+ t = wait_event_freezable_timeout(sdp->sd_logd_waitq,
test_bit(SDF_FORCE_AIL_FLUSH, &sdp->sd_flags) ||
gfs2_ail_flush_reqd(sdp) ||
gfs2_jrnl_flush_reqd(sdp) ||