diff options
author | Joe Eykholt <jeykholt@cisco.com> | 2010-07-20 18:19:37 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-28 10:05:48 -0400 |
commit | 42e9041467cf5fd33501b91b27e26807c259c896 (patch) | |
tree | 41a335a931e151f3fa00f384b5d1fb024421b7d2 /drivers/scsi/libfc/fc_disc.c | |
parent | 519e5135e2537c9dbc1cbcc0891b0a936ff5dcd2 (diff) |
[SCSI] libfc: convert rport lookup to be RCU safe
To allow LLD to do lookups on rports without grabbing a mutex,
make them RCU-safe. The caller of lport->tt.rport_lookup will
have the choice of holding disc_mutex or the rcu_read_lock().
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_disc.c')
-rw-r--r-- | drivers/scsi/libfc/fc_disc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c index c7985da8809..d0fa9a0ddc8 100644 --- a/drivers/scsi/libfc/fc_disc.c +++ b/drivers/scsi/libfc/fc_disc.c | |||
@@ -63,12 +63,12 @@ static void fc_disc_restart(struct fc_disc *); | |||
63 | void fc_disc_stop_rports(struct fc_disc *disc) | 63 | void fc_disc_stop_rports(struct fc_disc *disc) |
64 | { | 64 | { |
65 | struct fc_lport *lport; | 65 | struct fc_lport *lport; |
66 | struct fc_rport_priv *rdata, *next; | 66 | struct fc_rport_priv *rdata; |
67 | 67 | ||
68 | lport = disc->lport; | 68 | lport = disc->lport; |
69 | 69 | ||
70 | mutex_lock(&disc->disc_mutex); | 70 | mutex_lock(&disc->disc_mutex); |
71 | list_for_each_entry_safe(rdata, next, &disc->rports, peers) | 71 | list_for_each_entry_rcu(rdata, &disc->rports, peers) |
72 | lport->tt.rport_logoff(rdata); | 72 | lport->tt.rport_logoff(rdata); |
73 | mutex_unlock(&disc->disc_mutex); | 73 | mutex_unlock(&disc->disc_mutex); |
74 | } | 74 | } |
@@ -292,7 +292,7 @@ static void fc_disc_done(struct fc_disc *disc, enum fc_disc_event event) | |||
292 | * Skip ports which were never discovered. These are the dNS port | 292 | * Skip ports which were never discovered. These are the dNS port |
293 | * and ports which were created by PLOGI. | 293 | * and ports which were created by PLOGI. |
294 | */ | 294 | */ |
295 | list_for_each_entry(rdata, &disc->rports, peers) { | 295 | list_for_each_entry_rcu(rdata, &disc->rports, peers) { |
296 | if (!rdata->disc_id) | 296 | if (!rdata->disc_id) |
297 | continue; | 297 | continue; |
298 | if (rdata->disc_id == disc->disc_id) | 298 | if (rdata->disc_id == disc->disc_id) |