summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc/fc_rport.c
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2009-08-25 14:01:55 -0700
committerJames Bottomley <James.Bottomley@suse.de>2009-09-10 12:07:46 -0500
commit19f97e3c0acc5eb03486044f5428395b7690a01a (patch)
tree640a956483f932f778706001a3582c79189aa482 /drivers/scsi/libfc/fc_rport.c
parent48f00902ba40d3e4467782a42258b952437a89f9 (diff)
[SCSI] libfc: have rport_create do a lookup for pre-existing rports first
For future discovery patches, change rport_create to return a previously created rport_priv that has the FC_ID as long as it isn't in deleted state. 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/libfc/fc_rport.c')
-rw-r--r--drivers/scsi/libfc/fc_rport.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index a9087b31bce..29bb6fd1003 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -98,6 +98,10 @@ static struct fc_rport_priv *fc_rport_create(struct fc_lport *lport,
{
struct fc_rport_priv *rdata;
+ rdata = lport->tt.rport_lookup(lport, ids->port_id);
+ if (rdata)
+ return rdata;
+
rdata = kzalloc(sizeof(*rdata), GFP_KERNEL);
if (!rdata)
return NULL;