Whamcloud - gitweb
LU-4993 libcfs: convert nodemask_t to linux bitmask
[fs/lustre-release.git] / libcfs / include / libcfs / libcfs_cpu.h
index 50aca83..891fc21 100644 (file)
 
 #ifndef HAVE_LIBCFS_CPT
 
-#ifndef __KERNEL__
-typedef unsigned long          cpumask_t;
-typedef unsigned long          nodemask_t;
+#if !defined(__linux__) || !defined(__KERNEL__)
+typedef struct nodemask { DECLARE_BITMAP(bits, 1); } nodemask_t;
+typedef struct cpumask  { DECLARE_BITMAP(bits, 1); } cpumask_t;
+
+#define node_set(node, dst) __node_set((node), &(dst))
+static __always_inline void __node_set(int node, nodemask_t *dstp)
+{
+       set_bit(node, dstp->bits);
+}
 #endif
 
 struct cfs_cpt_table {