[SCSI] libfc: make rport module maintain the rport list
The list of remote ports (struct fc_rport_priv) has been maintained by the discovery module. In preparation for having lport->tt.rport_create() do a lookup first, maintain the rports list in the rport module. It will still be protected by the disc_mutex. The DNS rport is an exception for until after further patches. For now, do not add it to the list. The point-to-point rport will be in the discovery list. So at shutdown, it doesn't need to be separately logged out. 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>
This commit is contained in:
committed by
James Bottomley
parent
b5cbf08373
commit
48f00902ba
@@ -115,9 +115,6 @@ static void fc_disc_rport_callback(struct fc_lport *lport,
|
||||
case RPORT_EV_LOGO:
|
||||
case RPORT_EV_FAILED:
|
||||
case RPORT_EV_STOP:
|
||||
mutex_lock(&disc->disc_mutex);
|
||||
list_del(&rdata->peers);
|
||||
mutex_unlock(&disc->disc_mutex);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -385,9 +382,6 @@ static int fc_disc_new_target(struct fc_disc *disc,
|
||||
rdata = lport->tt.rport_create(lport, ids);
|
||||
if (!rdata)
|
||||
error = -ENOMEM;
|
||||
else
|
||||
list_add_tail(&rdata->peers,
|
||||
&disc->rports);
|
||||
}
|
||||
}
|
||||
if (rdata) {
|
||||
@@ -562,7 +556,6 @@ static int fc_disc_gpn_ft_parse(struct fc_disc *disc, void *buf, size_t len)
|
||||
rdata = lport->tt.rport_create(lport, &ids);
|
||||
if (rdata) {
|
||||
rdata->ops = &fc_disc_rport_ops;
|
||||
list_add_tail(&rdata->peers, &disc->rports);
|
||||
lport->tt.rport_login(rdata);
|
||||
} else
|
||||
printk(KERN_WARNING "libfc: Failed to allocate "
|
||||
@@ -709,7 +702,6 @@ static void fc_disc_single(struct fc_disc *disc, struct fc_disc_port *dp)
|
||||
if (rdata) {
|
||||
rdata->ops = &fc_disc_rport_ops;
|
||||
kfree(dp);
|
||||
list_add_tail(&rdata->peers, &disc->rports);
|
||||
lport->tt.rport_login(rdata);
|
||||
}
|
||||
return;
|
||||
|
Reference in New Issue
Block a user