gfs2: Switch to wait_event in gfs2_quotad
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 25 Aug 2023 09:06:20 +0000 (11:06 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 5 Sep 2023 13:58:17 +0000 (15:58 +0200)
In gfs2_quotad(), switch from an open-coded wait loop to
wait_event_interruptible_timeout().

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/quota.c

index 75be0d8..5201bb4 100644 (file)
@@ -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;