Whamcloud - gitweb
LU-488 ptlrpc_connection_put() LASSERT(!cfs_hlist_unhashed(&conn->c_hash))
[fs/lustre-release.git] / libcfs / libcfs / module.c
index 8e773d3..8278b4c 100644 (file)
@@ -386,6 +386,7 @@ static int init_libcfs_module(void)
         cfs_init_mutex(&cfs_trace_thread_sem);
         cfs_init_rwsem(&ioctl_list_sem);
         CFS_INIT_LIST_HEAD(&ioctl_list);
+        cfs_waitq_init(&cfs_race_waitq);
 
         rc = libcfs_debug_init(5 * 1024 * 1024);
         if (rc < 0) {
@@ -406,15 +407,23 @@ static int init_libcfs_module(void)
                 goto cleanup_lwt;
         }
 
+        rc = cfs_wi_startup();
+        if (rc) {
+                CERROR("startup workitem: error %d\n", rc);
+                goto cleanup_deregister;
+        }
+
         rc = insert_proc();
         if (rc) {
                 CERROR("insert_proc: error %d\n", rc);
-                goto cleanup_deregister;
+                goto cleanup_wi;
         }
 
         CDEBUG (D_OTHER, "portals setup OK\n");
         return (0);
 
+ cleanup_wi:
+        cfs_wi_shutdown();
  cleanup_deregister:
         cfs_psdev_deregister(&libcfs_dev);
  cleanup_lwt:
@@ -435,6 +444,7 @@ static void exit_libcfs_module(void)
         CDEBUG(D_MALLOC, "before Portals cleanup: kmem %d\n",
                cfs_atomic_read(&libcfs_kmemory));
 
+        cfs_wi_shutdown();
         rc = cfs_psdev_deregister(&libcfs_dev);
         if (rc)
                 CERROR("misc_deregister error %d\n", rc);