Whamcloud - gitweb
LU-4199 libcfs: Handle nodemask on UMP machines
[fs/lustre-release.git] / libcfs / libcfs / libcfs_cpu.c
index 98c0cb9..87dec68 100644 (file)
@@ -22,7 +22,7 @@
  */
 /*
  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2012, 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
  * Author: liang@whamcloud.com
  */
 
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
 #define DEBUG_SUBSYSTEM S_LNET
 
 #include <libcfs/libcfs.h>
 
-/** Global cpu partition table */
+/** Global CPU partition table */
 struct cfs_cpt_table   *cfs_cpt_table __read_mostly = NULL;
 EXPORT_SYMBOL(cfs_cpt_table);
 
@@ -61,6 +58,7 @@ cfs_cpt_table_alloc(unsigned int ncpt)
        LIBCFS_ALLOC(cptab, sizeof(*cptab));
        if (cptab != NULL) {
                cptab->ctb_version = CFS_CPU_VERSION_MAGIC;
+               set_bit(0, &cptab->ctb_nodemask);
                cptab->ctb_nparts  = ncpt;
        }
 
@@ -89,7 +87,7 @@ cfs_cpt_weight(struct cfs_cpt_table *cptab, int cpt)
 {
        return 1;
 }
-EXPORT_SYMBOL(cfs_cpt_number);
+EXPORT_SYMBOL(cfs_cpt_weight);
 
 int
 cfs_cpt_online(struct cfs_cpt_table *cptab, int cpt)
@@ -98,6 +96,13 @@ cfs_cpt_online(struct cfs_cpt_table *cptab, int cpt)
 }
 EXPORT_SYMBOL(cfs_cpt_online);
 
+nodemask_t *
+cfs_cpt_nodemask(struct cfs_cpt_table *cptab, int cpt)
+{
+       return &cptab->ctb_nodemask;
+}
+EXPORT_SYMBOL(cfs_cpt_cpumask);
+
 int
 cfs_cpt_set_cpu(struct cfs_cpt_table *cptab, int cpt, int cpu)
 {
@@ -175,7 +180,7 @@ cfs_cpt_of_cpu(struct cfs_cpt_table *cptab, int cpu)
 {
        return 0;
 }
-EXPORT_SYMBOL(cfs_cpt_from_cpu);
+EXPORT_SYMBOL(cfs_cpt_of_cpu);
 
 int
 cfs_cpt_bind(struct cfs_cpt_table *cptab, int cpt)