- l_wait_event(set->set_waitq, ptlrpcd_check(&env, pc), &lwi);
+
+ add_wait_queue(&set->set_waitq, &wait);
+ while (!ptlrpcd_check(&env, pc)) {
+ int ret;
+
+ if (timeout == 0)
+ ret = wait_woken(&wait, TASK_IDLE,
+ MAX_SCHEDULE_TIMEOUT);
+ else
+ ret = wait_woken(&wait, TASK_IDLE,
+ cfs_time_seconds(timeout));
+ if (ret != 0)
+ continue;
+ /* Timed out */
+ ptlrpc_expired_set(set);
+ break;
+ }
+ remove_wait_queue(&set->set_waitq, &wait);
+