staging/lustre/libcfs: add CPU table functions for uniprocessor
authorLi Xi <lixi@ddn.com>
Sun, 27 Apr 2014 17:06:58 +0000 (13:06 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Apr 2014 17:30:59 +0000 (10:30 -0700)
Some CPU table functions for uniprocessor architecture is
missing.

Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/8873
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
drivers/staging/lustre/include/linux/libcfs/linux/linux-mem.h
drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c

index d116fdfc5c417238d85abf0e9155399288998744..a140e5d918602059525505f939ff6bac61d0e434 100644 (file)
@@ -202,6 +202,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
  */
index 2af15d41e77aefe1e9925dce785bdeefe62b0f02..72c76ad96ce941d66f72f5458ef462e8abe29563 100644 (file)
 #include <linux/memcontrol.h>
 #include <linux/mm_inline.h>
 
+#ifndef HAVE_LIBCFS_CPT
+/* Need this for cfs_cpt_table */
+#include <libcfs/libcfs_cpu.h>
+#endif
+
 #define CFS_PAGE_MASK             (~((__u64)PAGE_CACHE_SIZE-1))
 #define page_index(p)       ((p)->index)
 
index 1fb37008cda242706108d2833b12588f68d77004..d985e83ba2c31cb944d6dfe4f73e5b3ab3317b4a 100644 (file)
@@ -74,6 +74,20 @@ cfs_cpt_table_free(struct cfs_cpt_table *cptab)
 }
 EXPORT_SYMBOL(cfs_cpt_table_free);
 
+int
+cfs_cpt_table_print(struct cfs_cpt_table *cptab, char *buf, int len)
+{
+       int     rc = 0;
+
+       rc = snprintf(buf, len, "%d\t: %d\n", 0, 0);
+       len -= rc;
+       if (len <= 0)
+               return -EFBIG;
+
+       return rc;
+}
+EXPORT_SYMBOL(cfs_cpt_table_print);
+
 int
 cfs_cpt_number(struct cfs_cpt_table *cptab)
 {
@@ -160,6 +174,13 @@ cfs_cpt_spread_node(struct cfs_cpt_table *cptab, int cpt)
 }
 EXPORT_SYMBOL(cfs_cpt_spread_node);
 
+int
+cfs_cpu_ht_nsiblings(int cpu)
+{
+       return 1;
+}
+EXPORT_SYMBOL(cfs_cpu_ht_nsiblings);
+
 int
 cfs_cpt_current(struct cfs_cpt_table *cptab, int remap)
 {