struct ptlrpc_thread *thread = (struct ptlrpc_thread *)arg;
ENTRY;
- cfs_daemonize(thread->t_name);
-
/* Record that the thread is running */
thread_set_flags(thread, SVC_RUNNING);
cfs_waitq_signal(&thread->t_ctl_waitq);
strcpy(pinger_thread.t_name, "ll_ping");
/* CLONE_VM and CLONE_FILES just avoid a needless copy, because we
- * just drop the VM and FILES in cfs_daemonize_ctxt() right away. */
- rc = cfs_create_thread(ptlrpc_pinger_main,
- &pinger_thread, CFS_DAEMON_FLAGS);
- if (rc < 0) {
+ * just drop the VM and FILES in kthread_run() right away. */
+ rc = PTR_ERR(kthread_run(ptlrpc_pinger_main,
+ &pinger_thread, pinger_thread.t_name));
+ if (IS_ERR_VALUE(rc)) {
CERROR("cannot start thread: %d\n", rc);
RETURN(rc);
}
time_t expire_time;
ENTRY;
- cfs_daemonize_ctxt("ll_evictor");
+ unshare_fs_struct();
CDEBUG(D_HA, "Starting Ping Evictor\n");
pet_state = PET_READY;
void ping_evictor_start(void)
{
- int rc;
+ cfs_task_t *task;
- if (++pet_refcount > 1)
- return;
+ if (++pet_refcount > 1)
+ return;
- cfs_waitq_init(&pet_waitq);
+ cfs_waitq_init(&pet_waitq);
- rc = cfs_create_thread(ping_evictor_main, NULL, CFS_DAEMON_FLAGS);
- if (rc < 0) {
- pet_refcount--;
- CERROR("Cannot start ping evictor thread: %d\n", rc);
- }
+ task = kthread_run(ping_evictor_main, NULL, "ll_evictor");
+ if (IS_ERR(task)) {
+ pet_refcount--;
+ CERROR("Cannot start ping evictor thread: %ld\n",
+ PTR_ERR(task));
+ }
}
EXPORT_SYMBOL(ping_evictor_start);