From: Hannes Reinecke <hare@suse.de>
To: Christophe Varoqui <christophe.varoqui@gmail.com>
Cc: Hannes Reinecke <hare@suse.com>, dm-devel@redhat.com
Subject: [PATCH 16/26] discovery: Pass in 'hwtable' for get_state() and scsi_sysfs_discovery()
Date: Mon, 20 Jun 2016 10:09:03 +0200 [thread overview]
Message-ID: <1466410153-23896-17-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1466410153-23896-1-git-send-email-hare@suse.de>
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
libmultipath/discovery.c | 28 ++++++++++++++--------------
libmultipath/discovery.h | 2 +-
multipathd/main.c | 2 +-
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 0bf1bc2..e598337 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1067,7 +1067,7 @@ get_vpd_sgio (int fd, int pg, char * str, int maxlen)
}
static int
-scsi_sysfs_pathinfo (struct path * pp)
+scsi_sysfs_pathinfo (struct path * pp, vector hwtable)
{
struct udev_device *parent;
const char *attr_path = NULL;
@@ -1109,7 +1109,7 @@ scsi_sysfs_pathinfo (struct path * pp)
/*
* set the hwe configlet pointer
*/
- pp->hwe = find_hwe(conf->hwtable, pp->vendor_id, pp->product_id, pp->rev);
+ pp->hwe = find_hwe(hwtable, pp->vendor_id, pp->product_id, pp->rev);
/*
* host / bus / target / lun
@@ -1134,7 +1134,7 @@ scsi_sysfs_pathinfo (struct path * pp)
}
static int
-ccw_sysfs_pathinfo (struct path * pp)
+ccw_sysfs_pathinfo (struct path * pp, vector hwtable)
{
struct udev_device *parent;
char attr_buff[NAME_SIZE];
@@ -1170,7 +1170,7 @@ ccw_sysfs_pathinfo (struct path * pp)
/*
* set the hwe configlet pointer
*/
- pp->hwe = find_hwe(conf->hwtable, pp->vendor_id, pp->product_id, NULL);
+ pp->hwe = find_hwe(hwtable, pp->vendor_id, pp->product_id, NULL);
/*
* host / bus / target / lun
@@ -1193,7 +1193,7 @@ ccw_sysfs_pathinfo (struct path * pp)
}
static int
-cciss_sysfs_pathinfo (struct path * pp)
+cciss_sysfs_pathinfo (struct path * pp, vector hwtable)
{
const char * attr_path = NULL;
struct udev_device *parent;
@@ -1233,7 +1233,7 @@ cciss_sysfs_pathinfo (struct path * pp)
/*
* set the hwe configlet pointer
*/
- pp->hwe = find_hwe(conf->hwtable, pp->vendor_id, pp->product_id, pp->rev);
+ pp->hwe = find_hwe(hwtable, pp->vendor_id, pp->product_id, pp->rev);
/*
* host / bus / target / lun
@@ -1323,7 +1323,7 @@ path_offline (struct path * pp)
}
int
-sysfs_pathinfo(struct path * pp)
+sysfs_pathinfo(struct path * pp, vector hwtable)
{
if (common_sysfs_pathinfo(pp))
return 1;
@@ -1339,13 +1339,13 @@ sysfs_pathinfo(struct path * pp)
if (pp->bus == SYSFS_BUS_UNDEF)
return 0;
else if (pp->bus == SYSFS_BUS_SCSI) {
- if (scsi_sysfs_pathinfo(pp))
+ if (scsi_sysfs_pathinfo(pp, hwtable))
return 1;
} else if (pp->bus == SYSFS_BUS_CCW) {
- if (ccw_sysfs_pathinfo(pp))
+ if (ccw_sysfs_pathinfo(pp, hwtable))
return 1;
} else if (pp->bus == SYSFS_BUS_CCISS) {
- if (cciss_sysfs_pathinfo(pp))
+ if (cciss_sysfs_pathinfo(pp, hwtable))
return 1;
}
return 0;
@@ -1397,7 +1397,7 @@ cciss_ioctl_pathinfo (struct path * pp, int mask)
}
int
-get_state (struct path * pp, int daemon)
+get_state (struct path * pp, vector hwtable, int daemon)
{
struct checker * c = &pp->checker;
int state;
@@ -1406,7 +1406,7 @@ get_state (struct path * pp, int daemon)
if (!checker_selected(c)) {
if (daemon) {
- if (pathinfo(pp, conf->hwtable, DI_SYSFS) != PATHINFO_OK) {
+ if (pathinfo(pp, hwtable, DI_SYSFS) != PATHINFO_OK) {
condlog(3, "%s: couldn't get sysfs pathinfo",
pp->dev);
return PATH_UNCHECKED;
@@ -1610,7 +1610,7 @@ pathinfo (struct path *pp, vector hwtable, int mask)
/*
* fetch info available in sysfs
*/
- if (mask & DI_SYSFS && sysfs_pathinfo(pp))
+ if (mask & DI_SYSFS && sysfs_pathinfo(pp, hwtable))
return PATHINFO_FAILED;
if (mask & DI_BLACKLIST && mask & DI_SYSFS) {
@@ -1649,7 +1649,7 @@ pathinfo (struct path *pp, vector hwtable, int mask)
if (mask & DI_CHECKER) {
if (path_state == PATH_UP) {
- pp->chkrstate = pp->state = get_state(pp, 0);
+ pp->chkrstate = pp->state = get_state(pp, hwtable, 0);
if (pp->state == PATH_UNCHECKED ||
pp->state == PATH_WILD)
goto blank;
diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h
index 45c8a4a..2619015 100644
--- a/libmultipath/discovery.h
+++ b/libmultipath/discovery.h
@@ -34,7 +34,7 @@ int path_discovery (vector pathvec, struct config * conf, int flag);
int do_tur (char *);
int path_offline (struct path *);
-int get_state (struct path * pp, int daemon);
+int get_state (struct path * pp, vector hwtable, int daemon);
int pathinfo (struct path *, vector hwtable, int mask);
int alloc_path_with_pathinfo (vector hwtable, struct udev_device *udevice,
int flag, struct path **pp_ptr);
diff --git a/multipathd/main.c b/multipathd/main.c
index 9a44390..fe80d1a 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1421,7 +1421,7 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
newstate = PATH_DOWN;
if (newstate == PATH_UP)
- newstate = get_state(pp, 1);
+ newstate = get_state(pp, conf->hwtable, 1);
else
checker_clear_message(&pp->checker);
--
2.6.6
next prev parent reply other threads:[~2016-06-20 8:09 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
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 ` Hannes Reinecke [this message]
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 16/26] discovery: Pass in 'hwtable' for get_state() and scsi_sysfs_discovery() 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=1466410153-23896-17-git-send-email-hare@suse.de \
--to=hare@suse.de \
--cc=christophe.varoqui@gmail.com \
--cc=dm-devel@redhat.com \
--cc=hare@suse.com \
/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).