From: "Benjamin Marzinski" <bmarzins@redhat.com>
To: Hannes Reinecke <hare@suse.de>
Cc: dm-devel@redhat.com, Hannes Reinecke <hare@suse.com>,
Christophe Varoqui <christophe.varoqui@gmail.com>
Subject: Re: [PATCH 02/26] Use 'mptable' as argument for find_mpe() and get_mpe_wwid()
Date: Fri, 1 Jul 2016 14:48:33 -0500 [thread overview]
Message-ID: <20160701194833.GX8095@octiron.msp.redhat.com> (raw)
In-Reply-To: <1466410153-23896-3-git-send-email-hare@suse.de>
On Mon, Jun 20, 2016 at 10:08:49AM +0200, Hannes Reinecke wrote:
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
> 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..2acee25 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 hwtable, char * wwid);
> +char * get_mpe_wwid (vector hwtable, char * alias);
Why do we call this vector hwtable, instead of mptable, since we want to
pass in the mptable?
>
> struct hwentry * alloc_hwe (void);
> struct mpentry * alloc_mpe (void);
> diff --git a/libmultipath/configure.c b/libmultipath/configure.c
> index 8e938c0..a830bcd 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->hwtable, dev);
And why are we passing in the hwtable? Shouldn't be be using
conf->mptable?
> /*
> * or directly a wwid
> diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
> index 4111fa5..f803cdc 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->hwtable, pp->wwid);
And here as well.
> 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..b00832e 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->hwtable, mpp->wwid);
dido
> 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->hwtable, pp->wwid);
dido.
> mpp->hwe = pp->hwe;
>
> strcpy(mpp->wwid, pp->wwid);
-Ben
> --
> 2.6.6
next prev parent reply other threads:[~2016-07-01 19:48 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-20 8:08 [PATCH 00/26] Userspace-RCU for config accesses Hannes Reinecke
2016-06-20 8:08 ` [PATCH 01/26] Revert patch 'move filter_devnode() under vector lock' Hannes Reinecke
2016-06-20 8:08 ` [PATCH 02/26] Use 'mptable' as argument for find_mpe() and get_mpe_wwid() Hannes Reinecke
2016-07-01 19:48 ` Benjamin Marzinski [this message]
2016-06-20 8:08 ` [PATCH 03/26] config: set 'deferred_remove' defaults at correct call Hannes Reinecke
2016-06-20 8:08 ` [PATCH 04/26] devmapper: explicit config settings Hannes Reinecke
2016-06-20 8:08 ` [PATCH 05/26] dmparser: use 'is_daemon' as argument for disassemble_map() Hannes Reinecke
2016-06-20 8:08 ` [PATCH 06/26] libmultipath: use 'is_daemon' as argument for domap() etc Hannes Reinecke
2016-06-20 8:08 ` [PATCH 07/26] libmultipath: drop 'daemon' configuration setting Hannes Reinecke
2016-06-20 8:08 ` [PATCH 08/26] libmultipath: Do not access 'conf->cmd' in domap() Hannes Reinecke
2016-06-20 8:08 ` [PATCH 09/26] libmultipath: add 'cmd' as argument for get_refwwid() Hannes Reinecke
2016-06-20 8:08 ` [PATCH 10/26] libmultipath: fallback to checking environment variable in get_udev_uid() Hannes Reinecke
2016-06-20 8:08 ` [PATCH 11/26] multipath: make 'cmd' internal to multipath program Hannes Reinecke
2016-06-20 8:08 ` [PATCH 12/26] multipath: make 'dev_type' internal to the " Hannes Reinecke
2016-06-20 8:09 ` [PATCH 13/26] multipath: make 'dev' " Hannes Reinecke
2016-06-20 8:09 ` [PATCH 14/26] libmultipath: separate out 'udev' config entry Hannes Reinecke
2016-06-20 8:09 ` [PATCH 15/26] libmultipath: use 'checkint' as argument for sysfs_set_scsi_tmo() Hannes Reinecke
2016-06-20 8:09 ` [PATCH 16/26] discovery: Pass in 'hwtable' for get_state() and scsi_sysfs_discovery() Hannes Reinecke
2016-06-20 8:09 ` [PATCH 17/26] libmultipath: use 'struct config' as argument for pathinfo() Hannes Reinecke
2016-07-01 20:25 ` Benjamin Marzinski
2016-07-04 5:49 ` Hannes Reinecke
2016-06-20 8:09 ` [PATCH 18/26] checkers: use 'multipath_dir' as argument Hannes Reinecke
2016-06-20 8:09 ` [PATCH 19/26] prio: " Hannes Reinecke
2016-06-20 8:09 ` [PATCH 20/26] libmultipath: use 'timeout' as argument for getprio() Hannes Reinecke
2016-06-20 8:09 ` [PATCH 21/26] libmultipath: use explicit 'config' argument for configuration file parsing Hannes Reinecke
2016-06-20 8:09 ` [PATCH 22/26] libmultipath: use (get, put)_multipath_config() accessors Hannes Reinecke
2016-06-20 8:09 ` [PATCH 23/26] multipathd: Fixup commandline argument handling Hannes Reinecke
2016-06-20 8:09 ` [PATCH 24/26] multipath: make 'struct config' a local variable Hannes Reinecke
2016-06-20 8:09 ` [PATCH 25/26] multipathd: use userspace RCU to access configuration Hannes Reinecke
2016-06-20 8:09 ` [PATCH 26/26] libmultipath: Allocate keywords directly Hannes Reinecke
2016-07-01 20:44 ` [PATCH 00/26] Userspace-RCU for config accesses Benjamin Marzinski
-- strict thread matches above, loose matches on Subject: below --
2016-07-04 7:08 [PATCHv2 " Hannes Reinecke
2016-07-04 7:08 ` [PATCH 02/26] Use 'mptable' as argument for find_mpe() and get_mpe_wwid() Hannes Reinecke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160701194833.GX8095@octiron.msp.redhat.com \
--to=bmarzins@redhat.com \
--cc=christophe.varoqui@gmail.com \
--cc=dm-devel@redhat.com \
--cc=hare@suse.com \
--cc=hare@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).