X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=libcfs%2Flibcfs%2Flibcfs_cpu.c;fp=libcfs%2Flibcfs%2Flibcfs_cpu.c;h=58a3a44477a4bb02e2bfd15fb63ffd80b75137c1;hp=68046a75a44120ecea0a5bfd5f3e50cda9a39676;hb=83a2dbe9e50d3a60312fa40f41052b23a3edb3ca;hpb=66172e3274ca3187edd519dd87a81a478a6d7259 diff --git a/libcfs/libcfs/libcfs_cpu.c b/libcfs/libcfs/libcfs_cpu.c index 68046a7..58a3a44 100644 --- a/libcfs/libcfs/libcfs_cpu.c +++ b/libcfs/libcfs/libcfs_cpu.c @@ -67,7 +67,6 @@ static char *cpu_pattern = "N"; module_param(cpu_pattern, charp, 0444); MODULE_PARM_DESC(cpu_pattern, "CPU partitions pattern"); -#ifdef CONFIG_SMP struct cfs_cpt_table *cfs_cpt_table_alloc(int ncpt) { struct cfs_cpt_table *cptab; @@ -1232,68 +1231,3 @@ failed_cpu_dead: #endif /* CONFIG_HOTPLUG_CPU */ return ret; } - -#else /* ! CONFIG_SMP */ - -struct cfs_cpt_table *cfs_cpt_table_alloc(int ncpt) -{ - struct cfs_cpt_table *cptab; - - if (ncpt != 1) { - CERROR("Can't support cpu partition number %d\n", ncpt); - return NULL; - } - - LIBCFS_ALLOC(cptab, sizeof(*cptab)); - if (!cptab) - return NULL; - - cpumask_set_cpu(0, cptab->ctb_cpumask); - node_set(0, cptab->ctb_nodemask); - - return cptab; -} -EXPORT_SYMBOL(cfs_cpt_table_alloc); - -int cfs_cpt_table_print(struct cfs_cpt_table *cptab, char *buf, int len) -{ - int rc; - - rc = snprintf(buf, len, "0\t: 0\n"); - len -= rc; - if (len <= 0) - return -EFBIG; - - return rc; -} -EXPORT_SYMBOL(cfs_cpt_table_print); - -int cfs_cpt_distance_print(struct cfs_cpt_table *cptab, char *buf, int len) -{ - int rc; - - rc = snprintf(buf, len, "0\t: 0:1\n"); - len -= rc; - if (len <= 0) - return -EFBIG; - - return rc; -} -EXPORT_SYMBOL(cfs_cpt_distance_print); - -void cfs_cpu_fini(void) -{ - if (cfs_cpt_table) { - cfs_cpt_table_free(cfs_cpt_table); - cfs_cpt_table = NULL; - } -} - -int cfs_cpu_init(void) -{ - cfs_cpt_table = cfs_cpt_table_alloc(1); - - return cfs_cpt_table ? 0 : -1; -} - -#endif /* !CONFIG_SMP */