From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Wilck Subject: [PATCH v2 7/7] multipathd: only grab conf once for filter_path() Date: Tue, 30 Oct 2018 22:22:49 +0100 Message-ID: <20181030212249.31127-8-mwilck@suse.com> References: <20181030212249.31127-1-mwilck@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20181030212249.31127-1-mwilck@suse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Christophe Varoqui Cc: Martin Wilck , dm-devel@redhat.com List-Id: dm-devel.ids This saves a possibly large number of cleanup push/pop calls and slightly improves readability. Reviewed-by: Benjamin Marzinski Signed-off-by: Martin Wilck --- multipathd/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/multipathd/main.c b/multipathd/main.c index 2f6aa3f0..6289718d 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -2334,16 +2334,17 @@ configure (struct vectors * vecs) goto fail; } + conf = get_multipath_config(); + pthread_cleanup_push(put_multipath_config, conf); vector_foreach_slot (vecs->pathvec, pp, i){ - conf = get_multipath_config(); - pthread_cleanup_push(put_multipath_config, conf); if (filter_path(conf, pp) > 0){ vector_del_slot(vecs->pathvec, i); free_path(pp); i--; } - pthread_cleanup_pop(1); } + pthread_cleanup_pop(1); + if (map_discovery(vecs)) { condlog(0, "configure failed at map discovery"); goto fail; -- 2.19.1