Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 161149
b: refs/heads/master
c: 48f0090
h: refs/heads/master
i:
  161147: 4f2d332
v: v3
  • Loading branch information
Joe Eykholt authored and James Bottomley committed Sep 10, 2009
1 parent f1b3847 commit f1afb5d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b5cbf083736e14911c32fca2a93c540a92e8413d
refs/heads/master: 48f00902ba40d3e4467782a42258b952437a89f9
8 changes: 0 additions & 8 deletions trunk/drivers/scsi/libfc/fc_disc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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 "
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 6 additions & 8 deletions trunk/drivers/scsi/libfc/fc_lport.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,11 @@ static void fc_lport_ptp_setup(struct fc_lport *lport,
ids.node_name = remote_wwnn;
ids.roles = FC_RPORT_ROLE_UNKNOWN;

if (lport->ptp_rp) {
mutex_lock(&lport->disc.disc_mutex);
if (lport->ptp_rp)
lport->tt.rport_logoff(lport->ptp_rp);
lport->ptp_rp = NULL;
}

lport->ptp_rp = lport->tt.rport_create(lport, &ids);
mutex_unlock(&lport->disc.disc_mutex);

lport->tt.rport_login(lport->ptp_rp);

Expand Down Expand Up @@ -931,10 +930,7 @@ static void fc_lport_reset_locked(struct fc_lport *lport)
if (lport->dns_rp)
lport->tt.rport_logoff(lport->dns_rp);

if (lport->ptp_rp) {
lport->tt.rport_logoff(lport->ptp_rp);
lport->ptp_rp = NULL;
}
lport->ptp_rp = NULL;

lport->tt.disc_stop(lport);

Expand Down Expand Up @@ -1304,7 +1300,9 @@ static void fc_lport_enter_dns(struct fc_lport *lport)

fc_lport_state_enter(lport, LPORT_ST_DNS);

mutex_lock(&lport->disc.disc_mutex);
rdata = lport->tt.rport_create(lport, &ids);
mutex_unlock(&lport->disc.disc_mutex);
if (!rdata)
goto err;

Expand Down
11 changes: 9 additions & 2 deletions trunk/drivers/scsi/libfc/fc_rport.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ static const char *fc_rport_state_names[] = {
* @lport: local port.
* @ids: remote port identifiers.
*
* Locking note: this may be called without locks held, but
* is usually called from discovery with the disc_mutex held.
* Locking note: must be called with the disc_mutex held.
*/
static struct fc_rport_priv *fc_rport_create(struct fc_lport *lport,
struct fc_rport_identifiers *ids)
Expand All @@ -115,6 +114,8 @@ static struct fc_rport_priv *fc_rport_create(struct fc_lport *lport,
rdata->maxframe_size = FC_MIN_MAX_PAYLOAD;
INIT_DELAYED_WORK(&rdata->retry_work, fc_rport_timeout);
INIT_WORK(&rdata->event_work, fc_rport_work);
if (ids->port_id != FC_FID_DIR_SERV)
list_add(&rdata->peers, &lport->disc.rports);
return rdata;
}

Expand Down Expand Up @@ -258,6 +259,12 @@ static void fc_rport_work(struct work_struct *work)
port_id = rdata->ids.port_id;
mutex_unlock(&rdata->rp_mutex);

if (port_id != FC_FID_DIR_SERV) {
mutex_lock(&lport->disc.disc_mutex);
list_del(&rdata->peers);
mutex_unlock(&lport->disc.disc_mutex);
}

if (rport_ops->event_callback) {
FC_RPORT_DBG(rdata, "callback ev %d\n", event);
rport_ops->event_callback(lport, rdata, event);
Expand Down

0 comments on commit f1afb5d

Please sign in to comment.