Whamcloud - gitweb
LU-6245 libcfs: remove prim wrappers for libcfs
[fs/lustre-release.git] / libcfs / libcfs / workitem.c
index 017f29f..d93c3e9 100644 (file)
@@ -41,6 +41,7 @@
 
 #define DEBUG_SUBSYSTEM S_LNET
 
+#include <linux/kthread.h>
 #include <libcfs/libcfs.h>
 
 #define CFS_WS_NAME_LEN         16
@@ -408,7 +409,8 @@ cfs_wi_sched_destroy(struct cfs_wi_sched *sched)
                               sched->ws_name);
 
                        spin_unlock(&cfs_wi_data.wi_glock);
-                       cfs_pause(cfs_time_seconds(1) / 20);
+                       set_current_state(TASK_UNINTERRUPTIBLE);
+                       schedule_timeout(cfs_time_seconds(1) / 20);
                        spin_lock(&cfs_wi_data.wi_glock);
                }
        }
@@ -541,7 +543,8 @@ cfs_wi_shutdown (void)
 
                while (sched->ws_nthreads != 0) {
                        spin_unlock(&cfs_wi_data.wi_glock);
-                       cfs_pause(cfs_time_seconds(1) / 20);
+                       set_current_state(TASK_UNINTERRUPTIBLE);
+                       schedule_timeout(cfs_time_seconds(1) / 20);
                        spin_lock(&cfs_wi_data.wi_glock);
                }
                spin_unlock(&cfs_wi_data.wi_glock);