From patchwork Mon Jun 20 08:08:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 9186831 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 0103860756 for ; Mon, 20 Jun 2016 08:13:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E083324B5B for ; Mon, 20 Jun 2016 08:13:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D54E025221; Mon, 20 Jun 2016 08:13:25 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3446824B5B for ; Mon, 20 Jun 2016 08:13:25 +0000 (UTC) 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 u5K89oPp001354; Mon, 20 Jun 2016 04:09:50 -0400 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 u5K89Y2l031168 for ; Mon, 20 Jun 2016 04:09:34 -0400 Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5K89Y9a023677 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 20 Jun 2016 04:09:34 -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 668F93B725; Mon, 20 Jun 2016 08:09:33 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9FC67AAB7; Mon, 20 Jun 2016 08:09:31 +0000 (UTC) From: Hannes Reinecke To: Christophe Varoqui Date: Mon, 20 Jun 2016 10:08:52 +0200 Message-Id: <1466410153-23896-6-git-send-email-hare@suse.de> In-Reply-To: <1466410153-23896-1-git-send-email-hare@suse.de> References: <1466410153-23896-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.30]); Mon, 20 Jun 2016 08:09:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 20 Jun 2016 08:09:33 +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.327 (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.24 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-loop: dm-devel@redhat.com Cc: Hannes Reinecke , dm-devel@redhat.com Subject: [dm-devel] [PATCH 05/26] dmparser: use 'is_daemon' as argument for disassemble_map() 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 Use 'is_daemon' as argument for disassemble_map() so that dmparser.c doesn't need to access 'struct config' anymore. Signed-off-by: Hannes Reinecke --- libmpathpersist/mpath_persist.c | 2 +- libmultipath/dmparser.c | 6 +++--- libmultipath/dmparser.h | 2 +- libmultipath/structs_vec.c | 2 +- multipath/main.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c index 35e8837..ad6aec9 100644 --- a/libmpathpersist/mpath_persist.c +++ b/libmpathpersist/mpath_persist.c @@ -395,7 +395,7 @@ get_mpvec (vector curmp, vector pathvec, char * refwwid) condlog(3, "params = %s", params); dm_get_status(mpp->alias, status); condlog(3, "status = %s", status); - disassemble_map (pathvec, params, mpp); + disassemble_map (pathvec, params, mpp, conf->daemon); /* * disassemble_map() can add new paths to pathvec. diff --git a/libmultipath/dmparser.c b/libmultipath/dmparser.c index 98fb559..9e79ecd 100644 --- a/libmultipath/dmparser.c +++ b/libmultipath/dmparser.c @@ -13,7 +13,6 @@ #include "structs.h" #include "util.h" #include "debug.h" -#include "config.h" #define WORD_SIZE 64 @@ -142,7 +141,8 @@ assemble_map (struct multipath * mp, char * params, int len) } extern int -disassemble_map (vector pathvec, char * params, struct multipath * mpp) +disassemble_map (vector pathvec, char * params, struct multipath * mpp, + int is_daemon) { char * word; char * p; @@ -351,7 +351,7 @@ disassemble_map (vector pathvec, char * params, struct multipath * mpp) WWID_SIZE - 1); } /* Only call this in multipath client mode */ - if (!conf->daemon && store_path(pathvec, pp)) + if (!is_daemon && store_path(pathvec, pp)) goto out1; } else { if (!strlen(pp->wwid) && diff --git a/libmultipath/dmparser.h b/libmultipath/dmparser.h index 1b45df0..e1badb0 100644 --- a/libmultipath/dmparser.h +++ b/libmultipath/dmparser.h @@ -1,3 +1,3 @@ int assemble_map (struct multipath *, char *, int); -int disassemble_map (vector, char *, struct multipath *); +int disassemble_map (vector, char *, struct multipath *, int); int disassemble_status (char *, struct multipath *); diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c index b00832e..1b1a5f3 100644 --- a/libmultipath/structs_vec.c +++ b/libmultipath/structs_vec.c @@ -259,7 +259,7 @@ update_multipath_table (struct multipath *mpp, vector pathvec) return 1; } - if (disassemble_map(pathvec, params, mpp)) { + if (disassemble_map(pathvec, params, mpp, conf->daemon)) { condlog(3, "%s: cannot disassemble map", mpp->alias); return 1; } diff --git a/multipath/main.c b/multipath/main.c index 0dbe281..30710ea 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -206,7 +206,7 @@ get_dm_mpvec (vector curmp, vector pathvec, char * refwwid) dm_get_status(mpp->alias, status); condlog(3, "status = %s", status); - disassemble_map(pathvec, params, mpp); + disassemble_map(pathvec, params, mpp, conf->daemon); /* * disassemble_map() can add new paths to pathvec.