Whamcloud - gitweb
LU-663 kernel: Some arch do not have NUMA features anymore
[fs/lustre-release.git] / libcfs / include / libcfs / linux / linux-prim.h
index 19fbca1..770c12c 100644 (file)
 #define CFS_NR_CPUS     1
 #endif
 
+#ifdef HAVE_SET_CPUS_ALLOWED
 #define cfs_set_cpus_allowed(t, mask)  set_cpus_allowed(t, mask)
+#else
+#define cfs_set_cpus_allowed(t, mask)  set_cpus_allowed_ptr(t, &(mask))
+#endif
+
 /*
  * cache
  */
@@ -184,18 +189,9 @@ typedef long                            cfs_task_state_t;
 /* Kernel thread */
 typedef int (*cfs_thread_t)(void *);
 
-static inline int cfs_kernel_thread(int (*fn)(void *),
-                                    void *arg, unsigned long flags)
-{
-        void *orig_info = current->journal_info;
-        int rc;
-
-        current->journal_info = NULL;
-        rc = kernel_thread(fn, arg, flags);
-        current->journal_info = orig_info;
-        return rc;
-}
-
+#define CFS_DAEMON_FLAGS (CLONE_VM | CLONE_FILES)
+extern int cfs_create_thread(int (*fn)(void *),
+                             void *arg, unsigned long flags);
 
 /*
  * Task struct