Skip to content

Commit

Permalink
gfs2: Switch to wait_event in gfs2_quotad
Browse files Browse the repository at this point in the history
In gfs2_quotad(), switch from an open-coded wait loop to
wait_event_interruptible_timeout().

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
  • Loading branch information
Andreas Gruenbacher committed Sep 5, 2023
1 parent fe4f794 commit e4a8b54
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions fs/gfs2/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {

Expand All @@ -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;
Expand Down

0 comments on commit e4a8b54

Please sign in to comment.