summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2023-08-25 12:06:20 +0300
committerAndreas Gruenbacher <agruenba@redhat.com>2023-09-05 16:58:17 +0300
commite4a8b5481c59a3f1252f595330c2d2cd038886b2 (patch)
treecf981dc07182fbf319576d523c0ae49d0cbed74b /fs
parentfe4f7940d212440334f06783e06a15d674013bb1 (diff)
downloadlinux-e4a8b5481c59a3f1252f595330c2d2cd038886b2.tar.xz
gfs2: Switch to wait_event in gfs2_quotad
In gfs2_quotad(), switch from an open-coded wait loop to wait_event_interruptible_timeout(). Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/quota.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 75be0d8e243f..5201bb403fc6 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -1557,7 +1557,6 @@ int gfs2_quotad(void *data)
unsigned long statfs_timeo = 0;
unsigned long quotad_timeo = 0;
unsigned long t = 0;
- DEFINE_WAIT(wait);
while (!kthread_should_stop()) {
@@ -1583,12 +1582,12 @@ int gfs2_quotad(void *data)
bypass:
t = min(quotad_timeo, statfs_timeo);
- prepare_to_wait(&sdp->sd_quota_wait, &wait, TASK_INTERRUPTIBLE);
- if (!sdp->sd_statfs_force_sync)
- t -= schedule_timeout(t);
- else
+ t = wait_event_interruptible_timeout(sdp->sd_quota_wait,
+ sdp->sd_statfs_force_sync,
+ t);
+
+ if (sdp->sd_statfs_force_sync)
t = 0;
- finish_wait(&sdp->sd_quota_wait, &wait);
}
return 0;