mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
gfs2: Switch to wait_event in gfs2_logd
[ Upstream commit6df373b09b] In gfs2_logd(), switch from an open-coded wait loop to wait_event_interruptible_timeout(). Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Stable-dep-of:b74cd55aa9("gfs2: low-memory forced flush fixes") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d0245b0669
commit
751facd363
@@ -1296,7 +1296,6 @@ int gfs2_logd(void *data)
|
|||||||
{
|
{
|
||||||
struct gfs2_sbd *sdp = data;
|
struct gfs2_sbd *sdp = data;
|
||||||
unsigned long t = 1;
|
unsigned long t = 1;
|
||||||
DEFINE_WAIT(wait);
|
|
||||||
|
|
||||||
while (!kthread_should_stop()) {
|
while (!kthread_should_stop()) {
|
||||||
|
|
||||||
@@ -1333,17 +1332,11 @@ int gfs2_logd(void *data)
|
|||||||
|
|
||||||
try_to_freeze();
|
try_to_freeze();
|
||||||
|
|
||||||
do {
|
t = wait_event_interruptible_timeout(sdp->sd_logd_waitq,
|
||||||
prepare_to_wait(&sdp->sd_logd_waitq, &wait,
|
gfs2_ail_flush_reqd(sdp) ||
|
||||||
TASK_INTERRUPTIBLE);
|
gfs2_jrnl_flush_reqd(sdp) ||
|
||||||
if (!gfs2_ail_flush_reqd(sdp) &&
|
kthread_should_stop(),
|
||||||
!gfs2_jrnl_flush_reqd(sdp) &&
|
t);
|
||||||
!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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user