From: James Simmons Date: Thu, 13 Feb 2014 01:06:40 +0000 (-0500) Subject: LU-4199 libcfs: Handle nodemask on UMP machines X-Git-Tag: 2.5.57~51 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=cd37ceeab166f467f275619421a735ba5d2b380d LU-4199 libcfs: Handle nodemask on UMP machines For UMP and SMP machines the struct cfs_cpt_table are defined differently. In the case handled by this patch nodemask is defined as a integer for the UMP case and as a pointer for the SMP case. This will cause a problem for ost_setup which reads the nodemask directly. Instead we create a UMP version of cfs_cpt_nodemask and use that in ost_setup. Change-Id: I0dd80f79cf4589fc98182786d3f970432388f1fe Signed-off-by: James Simmons Reviewed-on: http://review.whamcloud.com/9219 Tested-by: Jenkins Reviewed-by: Liang Zhen Tested-by: Maloo Reviewed-by: Li Xi Reviewed-by: Andreas Dilger --- diff --git a/libcfs/libcfs/libcfs_cpu.c b/libcfs/libcfs/libcfs_cpu.c index 775af69..87dec68 100644 --- a/libcfs/libcfs/libcfs_cpu.c +++ b/libcfs/libcfs/libcfs_cpu.c @@ -58,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; } @@ -95,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) { diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index a39381f..e14c61a 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -175,7 +175,7 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg) GOTO(out_service, rc); } - mask = cfs_cpt_table->ctb_nodemask; + mask = cfs_cpt_nodemask(cfs_cpt_table, CFS_CPT_ANY); /* event CPT feature is disabled in libcfs level by set partition * number to 1, we still want to set node affinity for io service */ if (cfs_cpt_number(cfs_cpt_table) == 1 && nodes_weight(*mask) > 1) {