Whamcloud - gitweb
Revert "LU-3427 build: fix 'error handling' issues"
[fs/lustre-release.git] / libcfs / libcfs / user-prim.c
index 0cc1e3d..9f2b7b3 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, Whamcloud, Inc.
+ * Copyright (c) 2011, 2012, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -125,7 +125,7 @@ void cfs_waitq_wait(struct cfs_waitlink *link, cfs_task_state_t state)
         (void)link;
 
         /* well, wait for something to happen */
-        cfs_call_wait_handler(0);
+       call_wait_handler(0);
 }
 
 int64_t cfs_waitq_timedwait(struct cfs_waitlink *link, cfs_task_state_t state,
@@ -133,7 +133,7 @@ int64_t cfs_waitq_timedwait(struct cfs_waitlink *link, cfs_task_state_t state,
 {
         LASSERT(link != NULL);
         (void)link;
-        cfs_call_wait_handler(timeout);
+       call_wait_handler(timeout);
         return 0;
 }
 
@@ -223,24 +223,25 @@ static void *cfs_thread_helper(void *data)
         return NULL;
 }
 
-int cfs_create_thread(cfs_thread_t func, void *arg, unsigned long flags)
+void *kthread_run(cfs_thread_t func, void *arg, const char namefmt[], ...)
 {
-        pthread_t tid;
-        pthread_attr_t tattr;
-        int rc;
-        struct lustre_thread_arg *targ_p = malloc(sizeof(struct lustre_thread_arg));
+       pthread_t tid;
+       pthread_attr_t tattr;
+       int rc;
+       struct lustre_thread_arg *targ_p =
+                               malloc(sizeof(struct lustre_thread_arg));
 
-        if ( targ_p == NULL )
-                return -ENOMEM;
+       if (targ_p == NULL)
+               return ERR_PTR(-ENOMEM);
 
-        targ_p->f = func;
-        targ_p->arg = arg;
+       targ_p->f = func;
+       targ_p->arg = arg;
 
-        pthread_attr_init(&tattr);
-        pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);
-        rc = pthread_create(&tid, &tattr, cfs_thread_helper, targ_p);
-        pthread_attr_destroy(&tattr);
-        return -rc;
+       pthread_attr_init(&tattr);
+       pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);
+       rc = pthread_create(&tid, &tattr, cfs_thread_helper, targ_p);
+       pthread_attr_destroy(&tattr);
+       return ERR_PTR(rc);
 }
 #endif
 
@@ -314,14 +315,9 @@ void cfs_enter_debugger(void)
          */
 }
 
-void cfs_daemonize(char *str)
+int unshare_fs_struct()
 {
-        return;
-}
-
-int cfs_daemonize_ctxt(char *str)
-{
-        return 0;
+       return 0;
 }
 
 cfs_sigset_t cfs_block_allsigs(void)