- lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(30),
- cfs_time_seconds(1),
- NULL, NULL);
- rc = l_wait_event(athread->t_ctl_waitq,
- lfsck_phase2_next_ready(lad) ||
- test_bit(LAD_EXIT, &lad->lad_flags) ||
- !thread_is_running(mthread),
- &lwi);
+ while (seconds > 0 &&
+ wait_event_idle_timeout(
+ athread->t_ctl_waitq,
+ lfsck_phase2_next_ready(lad) ||
+ test_bit(LAD_EXIT,
+ &lad->lad_flags) ||
+ !thread_is_running(mthread),
+ cfs_time_seconds(1)) == 0)
+ seconds -= 1;