Whamcloud - gitweb
LU-2850 kernel: 3.8 upstream kills daemonize()
[fs/lustre-release.git] / libcfs / libcfs / tracefile.c
index 916bdc9..2049908 100644 (file)
@@ -992,7 +992,6 @@ static int tracefiled(void *arg)
 
        /* we're started late enough that we pick up init's fs context */
        /* this is so broken in uml?  what on earth is going on? */
-       cfs_daemonize("ktracefiled");
 
        spin_lock_init(&pc.pc_lock);
        complete(&tctl->tctl_start);
@@ -1106,16 +1105,16 @@ int cfs_trace_start_thread(void)
 
        init_completion(&tctl->tctl_start);
        init_completion(&tctl->tctl_stop);
-        cfs_waitq_init(&tctl->tctl_waitq);
-        cfs_atomic_set(&tctl->tctl_shutdown, 0);
+       cfs_waitq_init(&tctl->tctl_waitq);
+       cfs_atomic_set(&tctl->tctl_shutdown, 0);
 
-        if (cfs_create_thread(tracefiled, tctl, 0) < 0) {
-                rc = -ECHILD;
-                goto out;
-        }
+       if (IS_ERR(kthread_run(tracefiled, tctl, "ktracefiled"))) {
+               rc = -ECHILD;
+               goto out;
+       }
 
        wait_for_completion(&tctl->tctl_start);
-        thread_running = 1;
+       thread_running = 1;
 out:
        mutex_unlock(&cfs_trace_thread_mutex);
         return rc;