Commit 457d63ea authored by NeilBrown's avatar NeilBrown Committed by Greg Kroah-Hartman
Browse files

staging: lustre: rename cfs_cpt_table to cfs_cpt_tab



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: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f72c3ab7
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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
+16 −16
Original line number Diff line number Diff line
@@ -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 */
+2 −2
Original line number Diff line number Diff line
@@ -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;

+3 −3
Original line number Diff line number Diff line
@@ -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) {
+1 −1
Original line number Diff line number Diff line
@@ -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;
}

Loading