From patchwork Tue Nov 30 17:21:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bmarzins@sourceware.org X-Patchwork-Id: 367511 Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAUHNmDj014461 for ; Tue, 30 Nov 2010 17:24:09 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oAUHLbEw024276; Tue, 30 Nov 2010 12:21:39 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oAUHLaB0027489 for ; Tue, 30 Nov 2010 12:21:36 -0500 Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.12]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oAUHLVgA010531 for ; Tue, 30 Nov 2010 12:21:31 -0500 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by mx1.redhat.com (8.13.8/8.13.8) with SMTP id oAUHLLJO016006 for ; Tue, 30 Nov 2010 12:21:22 -0500 Received: (qmail 26739 invoked by uid 9475); 30 Nov 2010 17:21:21 -0000 Date: 30 Nov 2010 17:21:21 -0000 Message-ID: <20101130172121.26737.qmail@sourceware.org> From: bmarzins@sourceware.org To: dm-cvs@sourceware.org, dm-devel@redhat.com X-RedHat-Spam-Score: -2.31 (RCVD_IN_DNSWL_MED,T_RP_MATCHES_RCVD) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.12 X-loop: dm-devel@redhat.com Subject: [dm-devel] multipath-tools/libmultipath discovery.c switc ... X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 30 Nov 2010 17:24:09 +0000 (UTC) --- 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;