summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2010-07-20 15:19:53 -0700
committerJames Bottomley <James.Bottomley@suse.de>2010-07-28 09:05:52 -0500
commit0685230c59b5482e04ab50e7afc51119ceaba651 (patch)
tree64fbf16efb314efc5cba7e313342f0d57ce81e95 /drivers/scsi
parentfdb068c6cd6e30d43664f856d3530715a5742713 (diff)
downloadblackbird-obmc-linux-0685230c59b5482e04ab50e7afc51119ceaba651.tar.gz
blackbird-obmc-linux-0685230c59b5482e04ab50e7afc51119ceaba651.zip
[SCSI] libfc: add discovery-private pointer for LLD
For VN_port to VN_port mode, FIP will do discovery and needs a way to find its state from the local port or discovery structure. It seems that any other LLD that implements its own discovery would also need something like this. Replace disc->lport with disc->priv, and use container_of to find the lport. We could use disc->priv for that, but container_of is smaller and faster. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/libfc/fc_disc.c14
-rw-r--r--drivers/scsi/libfc/fc_libfc.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index d0fa9a0ddc8d..04474556f2dc 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -65,7 +65,7 @@ void fc_disc_stop_rports(struct fc_disc *disc)
struct fc_lport *lport;
struct fc_rport_priv *rdata;
- lport = disc->lport;
+ lport = fc_disc_lport(disc);
mutex_lock(&disc->disc_mutex);
list_for_each_entry_rcu(rdata, &disc->rports, peers)
@@ -96,7 +96,7 @@ static void fc_disc_recv_rscn_req(struct fc_seq *sp, struct fc_frame *fp,
LIST_HEAD(disc_ports);
struct fc_disc_port *dp, *next;
- lport = disc->lport;
+ lport = fc_disc_lport(disc);
FC_DISC_DBG(disc, "Received an RSCN event\n");
@@ -275,7 +275,7 @@ static void fc_disc_start(void (*disc_callback)(struct fc_lport *,
*/
static void fc_disc_done(struct fc_disc *disc, enum fc_disc_event event)
{
- struct fc_lport *lport = disc->lport;
+ struct fc_lport *lport = fc_disc_lport(disc);
struct fc_rport_priv *rdata;
FC_DISC_DBG(disc, "Discovery complete\n");
@@ -313,7 +313,7 @@ static void fc_disc_done(struct fc_disc *disc, enum fc_disc_event event)
*/
static void fc_disc_error(struct fc_disc *disc, struct fc_frame *fp)
{
- struct fc_lport *lport = disc->lport;
+ struct fc_lport *lport = fc_disc_lport(disc);
unsigned long delay = 0;
FC_DISC_DBG(disc, "Error %ld, retries %d/%d\n",
@@ -353,7 +353,7 @@ static void fc_disc_error(struct fc_disc *disc, struct fc_frame *fp)
static void fc_disc_gpn_ft_req(struct fc_disc *disc)
{
struct fc_frame *fp;
- struct fc_lport *lport = disc->lport;
+ struct fc_lport *lport = fc_disc_lport(disc);
WARN_ON(!fc_lport_test_ready(lport));
@@ -396,7 +396,7 @@ static int fc_disc_gpn_ft_parse(struct fc_disc *disc, void *buf, size_t len)
struct fc_rport_identifiers ids;
struct fc_rport_priv *rdata;
- lport = disc->lport;
+ lport = fc_disc_lport(disc);
disc->seq_count++;
/*
@@ -733,7 +733,7 @@ int fc_disc_init(struct fc_lport *lport)
mutex_init(&disc->disc_mutex);
INIT_LIST_HEAD(&disc->rports);
- disc->lport = lport;
+ disc->priv = lport;
return 0;
}
diff --git a/drivers/scsi/libfc/fc_libfc.h b/drivers/scsi/libfc/fc_libfc.h
index f5c0ca4b6ef8..16d2162dda1f 100644
--- a/drivers/scsi/libfc/fc_libfc.h
+++ b/drivers/scsi/libfc/fc_libfc.h
@@ -52,7 +52,7 @@ extern unsigned int fc_debug_logging;
#define FC_DISC_DBG(disc, fmt, args...) \
FC_CHECK_LOGGING(FC_DISC_LOGGING, \
printk(KERN_INFO "host%u: disc: " fmt, \
- (disc)->lport->host->host_no, \
+ fc_disc_lport(disc)->host->host_no, \
##args))
#define FC_RPORT_ID_DBG(lport, port_id, fmt, args...) \
OpenPOWER on IntegriCloud