Whamcloud - gitweb
LU-6245 libcfs: remove prim wrappers for libcfs
[fs/lustre-release.git] / lnet / lnet / lib-eq.c
index c85fe45..d5cc380 100644 (file)
@@ -327,27 +327,25 @@ __must_hold(&the_lnet.ln_eq_wait_lock)
 {
        int             tms = *timeout_ms;
        int             wait;
-       wait_queue_t  wl;
+       wait_queue_t    wl;
        cfs_time_t      now;
 
        if (tms == 0)
                return -1; /* don't want to wait and no new event */
 
-       init_waitqueue_entry_current(&wl);
+       init_waitqueue_entry(&wl, current);
        set_current_state(TASK_INTERRUPTIBLE);
        add_wait_queue(&the_lnet.ln_eq_waitq, &wl);
 
        lnet_eq_wait_unlock();
 
        if (tms < 0) {
-               waitq_wait(&wl, TASK_INTERRUPTIBLE);
-
+               schedule();
        } else {
                struct timeval tv;
 
                now = cfs_time_current();
-               waitq_timedwait(&wl, TASK_INTERRUPTIBLE,
-                                   cfs_time_seconds(tms) / 1000);
+               schedule_timeout(cfs_time_seconds(tms) / 1000);
                cfs_duration_usec(cfs_time_sub(cfs_time_current(), now), &tv);
                tms -= (int)(tv.tv_sec * 1000 + tv.tv_usec / 1000);
                if (tms < 0) /* no more wait but may have new event */