From patchwork Mon Jul 4 07:08:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 9211731 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9DD2C60572 for ; Mon, 4 Jul 2016 07:12:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A30628470 for ; Mon, 4 Jul 2016 07:12:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 760322860D; Mon, 4 Jul 2016 07:12:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D4AC28600 for ; Mon, 4 Jul 2016 07:12:55 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6479WGT009320; Mon, 4 Jul 2016 03:09:32 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u64798t3017636 for ; Mon, 4 Jul 2016 03:09:08 -0400 Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u64798xD002701 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 4 Jul 2016 03:09:08 -0400 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0E93472D37; Mon, 4 Jul 2016 07:09:07 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4D261AC72; Mon, 4 Jul 2016 07:09:05 +0000 (UTC) From: Hannes Reinecke To: Christophe Varoqui Date: Mon, 4 Jul 2016 09:08:22 +0200 Message-Id: <1467616126-10036-3-git-send-email-hare@suse.de> In-Reply-To: <1467616126-10036-1-git-send-email-hare@suse.de> References: <1467616126-10036-1-git-send-email-hare@suse.de> X-Greylist: Sender IP whitelisted by DNSRBL, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 04 Jul 2016 07:09:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 04 Jul 2016 07:09:07 +0000 (UTC) for IP:'195.135.220.15' DOMAIN:'mx2.suse.de' HELO:'mx2.suse.de' FROM:'hare@suse.de' RCPT:'' X-RedHat-Spam-Score: -3.188 (BAYES_50, DCC_REPUT_00_12, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, SPF_PASS) 195.135.220.15 mx2.suse.de 195.135.220.15 mx2.suse.de X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Scanned-By: MIMEDefang 2.76 on 10.5.110.27 X-loop: dm-devel@redhat.com Cc: Hannes Reinecke , dm-devel@redhat.com Subject: [dm-devel] [PATCH 02/26] Use 'mptable' as argument for find_mpe() and get_mpe_wwid() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk 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-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Hannes Reinecke --- libmultipath/config.c | 8 ++++---- libmultipath/config.h | 4 ++-- libmultipath/configure.c | 2 +- libmultipath/propsel.c | 2 +- libmultipath/structs_vec.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libmultipath/config.c b/libmultipath/config.c index 8b9e770..00f3e53 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c @@ -125,7 +125,7 @@ find_hwe (vector hwtable, char * vendor, char * product, char * revision) } extern struct mpentry * -find_mpe (char * wwid) +find_mpe (vector mptable, char * wwid) { int i; struct mpentry * mpe; @@ -133,7 +133,7 @@ find_mpe (char * wwid) if (!wwid) return NULL; - vector_foreach_slot (conf->mptable, mpe, i) + vector_foreach_slot (mptable, mpe, i) if (mpe->wwid && !strcmp(mpe->wwid, wwid)) return mpe; @@ -141,7 +141,7 @@ find_mpe (char * wwid) } extern char * -get_mpe_wwid (char * alias) +get_mpe_wwid (vector mptable, char * alias) { int i; struct mpentry * mpe; @@ -149,7 +149,7 @@ get_mpe_wwid (char * alias) if (!alias) return NULL; - vector_foreach_slot (conf->mptable, mpe, i) + vector_foreach_slot (mptable, mpe, i) if (mpe->alias && strcmp(mpe->alias, alias) == 0) return mpe->wwid; diff --git a/libmultipath/config.h b/libmultipath/config.h index 466e31e..7693ca6 100644 --- a/libmultipath/config.h +++ b/libmultipath/config.h @@ -179,8 +179,8 @@ struct config { struct config * conf; struct hwentry * find_hwe (vector hwtable, char * vendor, char * product, char *revision); -struct mpentry * find_mpe (char * wwid); -char * get_mpe_wwid (char * alias); +struct mpentry * find_mpe (vector mptable, char * wwid); +char * get_mpe_wwid (vector mptable, char * alias); struct hwentry * alloc_hwe (void); struct mpentry * alloc_mpe (void); diff --git a/libmultipath/configure.c b/libmultipath/configure.c index 8e938c0..e49e7ea 100644 --- a/libmultipath/configure.c +++ b/libmultipath/configure.c @@ -1042,7 +1042,7 @@ get_refwwid (char * dev, enum devtypes dev_type, vector pathvec, char **wwid) /* * or may be an alias */ - refwwid = get_mpe_wwid(dev); + refwwid = get_mpe_wwid(conf->mptable, dev); /* * or directly a wwid diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c index 4111fa5..71a0941 100644 --- a/libmultipath/propsel.c +++ b/libmultipath/propsel.c @@ -409,7 +409,7 @@ select_prio (struct path * pp) goto out; } } - mpe = find_mpe(pp->wwid); + mpe = find_mpe(conf->mptable, pp->wwid); set_prio(mpe, "(LUN setting)"); set_prio(conf->overrides, "(overrides setting)"); set_prio(pp->hwe, "controller setting)"); diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c index 20a7457..38df71b 100644 --- a/libmultipath/structs_vec.c +++ b/libmultipath/structs_vec.c @@ -385,7 +385,7 @@ __setup_multipath (struct vectors * vecs, struct multipath * mpp, int reset) } set_multipath_wwid(mpp); - mpp->mpe = find_mpe(mpp->wwid); + mpp->mpe = find_mpe(conf->mptable, mpp->wwid); condlog(3, "%s: discover", mpp->alias); if (!mpp->hwe) @@ -469,7 +469,7 @@ add_map_with_path (struct vectors * vecs, if (!(mpp = alloc_multipath())) return NULL; - mpp->mpe = find_mpe(pp->wwid); + mpp->mpe = find_mpe(conf->mptable, pp->wwid); mpp->hwe = pp->hwe; strcpy(mpp->wwid, pp->wwid);