Whamcloud - gitweb
LU-5577 libcfs: fix warnings in libcfs/curproc.h
[fs/lustre-release.git] / libcfs / include / libcfs / libcfs_cpu.h
index ef15297..9751069 100644 (file)
 
 #ifndef HAVE_LIBCFS_CPT
 
-typedef unsigned long          cpumask_t;
-typedef unsigned long          nodemask_t;
+#ifndef __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 /* __KERNEL__ */
 
 struct cfs_cpt_table {
        /* # of CPU partitions */
@@ -195,6 +203,11 @@ void cfs_cpt_clear(struct cfs_cpt_table *cptab, int cpt);
 int cfs_cpt_spread_node(struct cfs_cpt_table *cptab, int cpt);
 
 /**
+ * return number of HTs in the same core of \a cpu
+ */
+int cfs_cpu_ht_nsiblings(int cpu);
+
+/**
  * iterate over all CPU partitions in \a cptab
  */
 #define cfs_cpt_for_each(i, cptab)     \