diff mbox

multipath-tools/libmultipath discovery.c switc ...

Message ID 20101130172121.26737.qmail@sourceware.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

bmarzins@sourceware.org Nov. 30, 2010, 5:21 p.m. UTC
None
diff mbox

Patch

--- multipath-tools/libmultipath/discovery.c	2010/09/03 03:46:12	1.32.2.16
+++ multipath-tools/libmultipath/discovery.c	2010/11/30 17:21:19	1.32.2.17
@@ -477,24 +477,6 @@ 
 }
 
 static int
-sysfs_get_driver (char *sysfs_path, char * dev, char *driver)
-{
-	char path[FILE_NAME_SIZE];
-	char buff[SYSFS_NAME_LEN];
-
-	if (safe_sprintf(path, "%s/block/%s/device/driver", sysfs_path, dev)) {
-		condlog(0, "driver path too small");
-		return 1;
-	}
-	if (sysfs_get_link(path, buff, SYSFS_NAME_LEN) < 0) {
-		condlog(0, "can't get driver link: %s", strerror(errno));
-		return 1;
-	}
-	basename(buff, driver);
-	return 0;
-}
-
-static int
 sysfs_get_bus (char * sysfs_path, struct path * pp)
 {
 	struct sysfs_device *sdev;
@@ -536,9 +518,8 @@ 
 
 	while (loop--) {
 		sdev = sysfs_open_device_path(attr_buff);
-		if(!strncmp(pp->dev,"cciss",5)) 
-                         sysfs_get_driver(sysfs_path, pp->dev,
-                             sdev->bus);
+		if(!strncmp(pp->dev,"cciss",5))
+			strcpy(sdev->bus, "cciss");
 
 		if (strlen(sdev->bus))
 			break;
@@ -549,8 +530,7 @@ 
 #else
 	sdev = sysfs_open_device_path(attr_buff);
 	if(!strncmp(pp->dev,"cciss",5))
-                  sysfs_get_driver(sysfs_path, pp->dev,
-                     sdev->bus);
+		strcpy(sdev->bus, "cciss");
 #endif
 
 	if (!strncmp(sdev->bus, "scsi", 4))
--- multipath-tools/libmultipath/switchgroup.c	2010/09/03 20:59:14	1.5.2.3
+++ multipath-tools/libmultipath/switchgroup.c	2010/11/30 17:21:19	1.5.2.4
@@ -36,7 +36,7 @@ 
 				enabled_paths++;
 			}
 		}
-		if (conf->pg_prio_calc == PG_PRIO_CALC_AVG)
+		if (conf->pg_prio_calc == PG_PRIO_CALC_AVG && enabled_paths)
 			pgp->priority = priority / enabled_paths;
 		else
 			pgp->priority = priority;