File libcpuset-rm-cpuonline.diff of Package libcpuset

From: Paul Jackson <pj@sgi.com>
Subject: Fix wrong number of CPUs
References: bnc #468091


Acked-by: Bernhard Walle <bwalle@suse.de>

---
 libcpuset.c |   22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

--- a/libcpuset.c
+++ b/libcpuset.c
@@ -1,7 +1,7 @@
 /*
  * cpuset user library implementation.
  *
- * Copyright (c) 2006-2007 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (c) 2006-2008 Silicon Graphics, Inc. All rights reserved.
  *
  * Paul Jackson <pj@sgi.com>
  */
@@ -1016,24 +1016,6 @@ static int store_mask(const char *path,
 }
 
 /*
- * Return 1 if 'cpu' is online, else 0 if offline.  Tests the file
- * /sys/devices/system/cpu/cpuN/online file for 0 or 1 contents
- * were N == cpu number.
- */
-
-static char cpu_online(unsigned int cpu)
-{
-	char online;
-	char cpupath[PATH_MAX];
-
-	(void) snprintf(cpupath, sizeof(cpupath),
-		"/sys/devices/system/cpu/cpu%d/online", cpu);
-	if (read_flag(cpupath, &online) < 0)
-		return 0;	/* oops - guess that cpu's not there */
-	return online;
-}
-
-/*
  * The cpunodemap maps each cpu in [0 ... cpuset_cpus_nbits()),
  * to the node on which that cpu resides or cpuset_mems_nbits().
  *
@@ -1136,8 +1118,6 @@ static void rebuild_map()
 				continue;
 			if (cpu >= ncpus || mem >= nmems)
 				continue;
-			if (!cpu_online(cpu))
-				continue;
 			cpunodemap.map[cpu] = mem;
 		}
 		closedir(dir2);
openSUSE Build Service is sponsored by