}
if (ptlrpc_import_in_recovery(imp)) {
- struct l_wait_info lwi;
long timeout;
if (AT_OFF) {
timeout = at_get(&imp->imp_at.iat_service_estimate[idx]) * HZ;
}
- lwi = LWI_TIMEOUT_INTR(cfs_timeout_cap(timeout),
- back_to_sleep, LWI_ON_SIGNAL_NOOP, NULL);
- rc = l_wait_event(imp->imp_recovery_waitq,
- !ptlrpc_import_in_recovery(imp), &lwi);
+ if (wait_event_idle_timeout(imp->imp_recovery_waitq,
+ !ptlrpc_import_in_recovery(imp),
+ cfs_timeout_cap(timeout)) == 0)
+ l_wait_event_abortable(
+ imp->imp_recovery_waitq,
+ !ptlrpc_import_in_recovery(imp));
}
spin_lock(&imp->imp_lock);
spin_lock(&req->rq_lock);
if (req->rq_invalid_rqset) {
- struct l_wait_info lwi = LWI_TIMEOUT(5 * HZ,
- back_to_sleep, NULL);
-
req->rq_invalid_rqset = 0;
spin_unlock(&req->rq_lock);
- l_wait_event(req->rq_set_waitq, !req->rq_set, &lwi);
+ if (wait_event_idle_timeout(req->rq_set_waitq,
+ !req->rq_set,
+ 5 * HZ) == 0)
+ wait_event_idle(req->rq_set_waitq,
+ !req->rq_set);
} else if (req->rq_set) {
/* If we have a valid "rq_set", just reuse it to avoid double
* linked.