Whamcloud - gitweb
LU-1346 libcfs: cleanup waitq related primitives
[fs/lustre-release.git] / lustre / ptlrpc / events.c
index b25c72f..b2c7338 100644 (file)
@@ -379,7 +379,7 @@ void request_in_callback(lnet_event_t *ev)
 
        /* NB everything can disappear under us once the request
         * has been queued and we unlock, so do the wake now... */
-       cfs_waitq_signal(&svcpt->scp_waitq);
+       wake_up(&svcpt->scp_waitq);
 
        spin_unlock(&svcpt->scp_lock);
        EXIT;
@@ -470,7 +470,7 @@ void server_bulk_callback (lnet_event_t *ev)
                desc->bd_md_count--;
                /* This is the last callback no matter what... */
                if (desc->bd_md_count == 0)
-                       cfs_waitq_signal(&desc->bd_waitq);
+                       wake_up(&desc->bd_waitq);
        }
 
        spin_unlock(&desc->bd_lock);
@@ -553,38 +553,38 @@ int ptlrpc_uuid_to_peer (struct obd_uuid *uuid,
 
 void ptlrpc_ni_fini(void)
 {
-        cfs_waitq_t         waitq;
-        struct l_wait_info  lwi;
-        int                 rc;
-        int                 retries;
-
-        /* Wait for the event queue to become idle since there may still be
-         * messages in flight with pending events (i.e. the fire-and-forget
-         * messages == client requests and "non-difficult" server
-         * replies */
-
-        for (retries = 0;; retries++) {
-                rc = LNetEQFree(ptlrpc_eq_h);
-                switch (rc) {
-                default:
-                        LBUG();
-
-                case 0:
-                        LNetNIFini();
-                        return;
-
-                case -EBUSY:
-                        if (retries != 0)
-                                CWARN("Event queue still busy\n");
-
-                        /* Wait for a bit */
-                        cfs_waitq_init(&waitq);
-                        lwi = LWI_TIMEOUT(cfs_time_seconds(2), NULL, NULL);
-                        l_wait_event(waitq, 0, &lwi);
-                        break;
-                }
-        }
-        /* notreached */
+       wait_queue_head_t         waitq;
+       struct l_wait_info  lwi;
+       int                 rc;
+       int                 retries;
+
+       /* Wait for the event queue to become idle since there may still be
+        * messages in flight with pending events (i.e. the fire-and-forget
+        * messages == client requests and "non-difficult" server
+        * replies */
+
+       for (retries = 0;; retries++) {
+               rc = LNetEQFree(ptlrpc_eq_h);
+               switch (rc) {
+               default:
+                       LBUG();
+
+               case 0:
+                       LNetNIFini();
+                       return;
+
+               case -EBUSY:
+                       if (retries != 0)
+                               CWARN("Event queue still busy\n");
+
+                       /* Wait for a bit */
+                       init_waitqueue_head(&waitq);
+                       lwi = LWI_TIMEOUT(cfs_time_seconds(2), NULL, NULL);
+                       l_wait_event(waitq, 0, &lwi);
+                       break;
+               }
+       }
+       /* notreached */
 }
 
 lnet_pid_t ptl_get_pid(void)