]> git.itanic.dy.fi Git - linux-stable/commitdiff
staging: lustre: rename cfs_cpt_table to cfs_cpt_tab
authorNeilBrown <neilb@suse.com>
Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 16:29:09 +0000 (18:29 +0200)
The variable "cfs_cpt_table" has the same name as
the structure "struct cfs_cpt_table".
This makes it hard to use #define to make one disappear
on a uni-processor build, but keep the other.
So rename the variable to cfs_cpt_tab.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c
drivers/staging/lustre/lnet/libcfs/module.c
drivers/staging/lustre/lnet/lnet/api-ni.c
drivers/staging/lustre/lnet/selftest/framework.c
drivers/staging/lustre/lustre/ptlrpc/client.c
drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c
drivers/staging/lustre/lustre/ptlrpc/service.c

index 813ba4564bb92fbe577a668c67d8fc6ed91991c6..552e9f5c277e9682858199b209c384bb22aa9e5e 100644 (file)
@@ -59,9 +59,9 @@
  *   . NUMA allocators, CPU affinity threads are built over CPU partitions,
  *     instead of HW CPUs or HW nodes.
  *
- *   . By default, Lustre modules should refer to the global cfs_cpt_table,
+ *   . By default, Lustre modules should refer to the global cfs_cpt_tab,
  *     instead of accessing HW CPUs directly, so concurrency of Lustre can be
- *     configured by cpu_npartitions of the global cfs_cpt_table
+ *     configured by cpu_npartitions of the global cfs_cpt_tab
  *
  *   . If cpu_npartitions=1(all CPUs in one pool), lustre should work the
  *     same way as 2.2 or earlier versions
@@ -329,7 +329,7 @@ cfs_cpt_bind(struct cfs_cpt_table *cptab, int cpt)
 }
 #endif /* CONFIG_SMP */
 
-extern struct cfs_cpt_table    *cfs_cpt_table;
+extern struct cfs_cpt_table    *cfs_cpt_tab;
 
 /**
  * destroy a CPU partition table
index ac6fd11ae9d65889f59aa547654b20b1e912da15..2133ffec49a93734ceabdbd86f0583f4061dd9f2 100644 (file)
@@ -34,8 +34,8 @@
 #include <linux/libcfs/libcfs.h>
 
 /** Global CPU partition table */
-struct cfs_cpt_table   *cfs_cpt_table __read_mostly;
-EXPORT_SYMBOL(cfs_cpt_table);
+struct cfs_cpt_table   *cfs_cpt_tab __read_mostly;
+EXPORT_SYMBOL(cfs_cpt_tab);
 #define DEBUG_SUBSYSTEM S_LNET
 
 #include <linux/cpu.h>
@@ -1037,8 +1037,8 @@ static int cfs_cpu_dead(unsigned int cpu)
 void
 cfs_cpu_fini(void)
 {
-       if (cfs_cpt_table)
-               cfs_cpt_table_free(cfs_cpt_table);
+       if (cfs_cpt_tab)
+               cfs_cpt_table_free(cfs_cpt_tab);
 
 #ifdef CONFIG_HOTPLUG_CPU
        if (lustre_cpu_online > 0)
@@ -1053,7 +1053,7 @@ cfs_cpu_init(void)
 {
        int ret = 0;
 
-       LASSERT(!cfs_cpt_table);
+       LASSERT(!cfs_cpt_tab);
 
        memset(&cpt_data, 0, sizeof(cpt_data));
 
@@ -1088,17 +1088,17 @@ cfs_cpu_init(void)
                        goto failed;
                }
 
-               cfs_cpt_table = cfs_cpt_table_create_pattern(cpu_pattern_dup);
+               cfs_cpt_tab = cfs_cpt_table_create_pattern(cpu_pattern_dup);
                kfree(cpu_pattern_dup);
-               if (!cfs_cpt_table) {
+               if (!cfs_cpt_tab) {
                        CERROR("Failed to create cptab from pattern %s\n",
                               cpu_pattern);
                        goto failed;
                }
 
        } else {
-               cfs_cpt_table = cfs_cpt_table_create(cpu_npartitions);
-               if (!cfs_cpt_table) {
+               cfs_cpt_tab = cfs_cpt_table_create(cpu_npartitions);
+               if (!cfs_cpt_tab) {
                        CERROR("Failed to create ptable with npartitions %d\n",
                               cpu_npartitions);
                        goto failed;
@@ -1106,7 +1106,7 @@ cfs_cpu_init(void)
        }
 
        spin_lock(&cpt_data.cpt_lock);
-       if (cfs_cpt_table->ctb_version != cpt_data.cpt_version) {
+       if (cfs_cpt_tab->ctb_version != cpt_data.cpt_version) {
                spin_unlock(&cpt_data.cpt_lock);
                CERROR("CPU hotplug/unplug during setup\n");
                goto failed;
@@ -1115,7 +1115,7 @@ cfs_cpu_init(void)
 
        LCONSOLE(0, "HW nodes: %d, HW CPU cores: %d, npartitions: %d\n",
                 num_online_nodes(), num_online_cpus(),
-                cfs_cpt_number(cfs_cpt_table));
+                cfs_cpt_number(cfs_cpt_tab));
        return 0;
 
  failed:
@@ -1128,18 +1128,18 @@ cfs_cpu_init(void)
 void
 cfs_cpu_fini(void)
 {
-       if (cfs_cpt_table) {
-               cfs_cpt_table_free(cfs_cpt_table);
-               cfs_cpt_table = NULL;
+       if (cfs_cpt_tab) {
+               cfs_cpt_table_free(cfs_cpt_tab);
+               cfs_cpt_tab = NULL;
        }
 }
 
 int
 cfs_cpu_init(void)
 {
-       cfs_cpt_table = cfs_cpt_table_alloc(1);
+       cfs_cpt_tab = cfs_cpt_table_alloc(1);
 
-       return cfs_cpt_table ? 0 : -1;
+       return cfs_cpt_tab ? 0 : -1;
 }
 
 #endif /* CONFIG_SMP */
index 0e3bfe4e2cb1e283d5fa26d6a4b866a4b23ce83e..6d1c1ad63e16d2db5649ffd0be48b39ddd7ef242 100644 (file)
@@ -461,14 +461,14 @@ static int __proc_cpt_table(void *data, int write,
        if (write)
                return -EPERM;
 
-       LASSERT(cfs_cpt_table);
+       LASSERT(cfs_cpt_tab);
 
        while (1) {
                buf = kzalloc(len, GFP_KERNEL);
                if (!buf)
                        return -ENOMEM;
 
-               rc = cfs_cpt_table_print(cfs_cpt_table, buf, len);
+               rc = cfs_cpt_table_print(cfs_cpt_tab, buf, len);
                if (rc >= 0)
                        break;
 
index 90266be0132deca93e5d413ff7a935c7e065859f..f9ed6977056ce3ec7f5dbd0ef3f34ad3b8aacb8b 100644 (file)
@@ -1413,9 +1413,9 @@ int lnet_lib_init(void)
 
        memset(&the_lnet, 0, sizeof(the_lnet));
 
-       /* refer to global cfs_cpt_table for now */
-       the_lnet.ln_cpt_table   = cfs_cpt_table;
-       the_lnet.ln_cpt_number  = cfs_cpt_number(cfs_cpt_table);
+       /* refer to global cfs_cpt_tab for now */
+       the_lnet.ln_cpt_table   = cfs_cpt_tab;
+       the_lnet.ln_cpt_number  = cfs_cpt_number(cfs_cpt_tab);
 
        LASSERT(the_lnet.ln_cpt_number > 0);
        if (the_lnet.ln_cpt_number > LNET_CPT_MAX) {
index 045eecd23e0a79ad86e5e57bbe08e3d9182224d4..741af10560ad1d8434e63b0d2c239bd91caef117 100644 (file)
@@ -588,7 +588,7 @@ sfw_load_test(struct sfw_test_instance *tsi)
 
        CDEBUG(D_NET, "Reserved %d buffers for test %s\n",
               nbuf * (srpc_serv_is_framework(svc) ?
-                      2 : cfs_cpt_number(cfs_cpt_table)), svc->sv_name);
+                      2 : cfs_cpt_number(cfs_cpt_tab)), svc->sv_name);
        return 0;
 }
 
index a51feaeb77343783744a6ce5c7e8cb42960c605b..b2b2e94de56f96d1c562800f245a899ba3948134 100644 (file)
@@ -938,9 +938,9 @@ struct ptlrpc_request_set *ptlrpc_prep_set(void)
        struct ptlrpc_request_set *set;
        int cpt;
 
-       cpt = cfs_cpt_current(cfs_cpt_table, 0);
+       cpt = cfs_cpt_current(cfs_cpt_tab, 0);
        set = kzalloc_node(sizeof(*set), GFP_NOFS,
-                          cfs_cpt_spread_node(cfs_cpt_table, cpt));
+                          cfs_cpt_spread_node(cfs_cpt_tab, cpt));
        if (!set)
                return NULL;
        atomic_set(&set->set_refcount, 1);
index c0fa13942bd8a596a8786eef854bb42b3ba7d1bd..1f7c18d1c95e5b2e1ba4d4fd52c47c472c5b4a64 100644 (file)
@@ -175,7 +175,7 @@ ptlrpcd_select_pc(struct ptlrpc_request *req)
        if (req && req->rq_send_state != LUSTRE_IMP_FULL)
                return &ptlrpcd_rcv;
 
-       cpt = cfs_cpt_current(cfs_cpt_table, 1);
+       cpt = cfs_cpt_current(cfs_cpt_tab, 1);
        if (!ptlrpcds_cpt_idx)
                idx = cpt;
        else
@@ -387,7 +387,7 @@ static int ptlrpcd(void *arg)
        int exit = 0;
 
        unshare_fs_struct();
-       if (cfs_cpt_bind(cfs_cpt_table, pc->pc_cpt) != 0)
+       if (cfs_cpt_bind(cfs_cpt_tab, pc->pc_cpt) != 0)
                CWARN("Failed to bind %s on CPT %d\n", pc->pc_name, pc->pc_cpt);
 
        /*
@@ -529,7 +529,7 @@ static int ptlrpcd_partners(struct ptlrpcd *pd, int index)
 
        size = sizeof(struct ptlrpcd_ctl *) * pc->pc_npartners;
        pc->pc_partners = kzalloc_node(size, GFP_NOFS,
-                                      cfs_cpt_spread_node(cfs_cpt_table,
+                                      cfs_cpt_spread_node(cfs_cpt_tab,
                                                           pc->pc_cpt));
        if (!pc->pc_partners) {
                pc->pc_npartners = 0;
@@ -675,7 +675,7 @@ static int ptlrpcd_init(void)
        /*
         * Determine the CPTs that ptlrpcd threads will run on.
         */
-       cptable = cfs_cpt_table;
+       cptable = cfs_cpt_tab;
        ncpts = cfs_cpt_number(cptable);
        if (ptlrpcd_cpts) {
                struct cfs_expr_list *el;
@@ -829,7 +829,7 @@ static int ptlrpcd_init(void)
 
                size = offsetof(struct ptlrpcd, pd_threads[nthreads]);
                pd = kzalloc_node(size, GFP_NOFS,
-                                 cfs_cpt_spread_node(cfs_cpt_table, cpt));
+                                 cfs_cpt_spread_node(cfs_cpt_tab, cpt));
                if (!pd) {
                        rc = -ENOMEM;
                        goto out;
index 4265e8d00ca5e1dbe4db15646e0587a47a5bbb38..1d28139c950e4d5ac98a5d55b3d0983966d7a547 100644 (file)
@@ -205,7 +205,7 @@ struct ptlrpc_hr_partition {
 #define HRT_STOPPING 1
 
 struct ptlrpc_hr_service {
-       /* CPU partition table, it's just cfs_cpt_table for now */
+       /* CPU partition table, it's just cfs_cpt_tab for now */
        struct cfs_cpt_table            *hr_cpt_table;
        /** controller sleep waitq */
        wait_queue_head_t                       hr_waitq;
@@ -562,7 +562,7 @@ ptlrpc_register_service(struct ptlrpc_service_conf *conf,
 
        cptable = cconf->cc_cptable;
        if (!cptable)
-               cptable = cfs_cpt_table;
+               cptable = cfs_cpt_tab;
 
        if (!conf->psc_thr.tc_cpu_affinity) {
                ncpts = 1;
@@ -2516,7 +2516,7 @@ int ptlrpc_hr_init(void)
        int weight;
 
        memset(&ptlrpc_hr, 0, sizeof(ptlrpc_hr));
-       ptlrpc_hr.hr_cpt_table = cfs_cpt_table;
+       ptlrpc_hr.hr_cpt_table = cfs_cpt_tab;
 
        ptlrpc_hr.hr_partitions = cfs_percpt_alloc(ptlrpc_hr.hr_cpt_table,
                                                   sizeof(*hrp));