Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10077
b: refs/heads/master
c: d16794f
h: refs/heads/master
i:
  10075: fcddd8a
v: v3
  • Loading branch information
James.Smart@Emulex.Com authored and James Bottomley committed Oct 16, 2005
1 parent 50caea1 commit e5cb079
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 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: 7a9366e46c167930f8bd9e378a3656861c5a41b6
refs/heads/master: d16794f6ac8d9b50f62e02a6e6175ae1a30d0ccd
13 changes: 10 additions & 3 deletions trunk/drivers/scsi/scsi_transport_fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,12 +819,15 @@ show_fc_private_host_tgtid_bind_type(struct class_device *cdev, char *buf)
return snprintf(buf, FC_BINDTYPE_MAX_NAMELEN, "%s\n", name);
}

#define get_list_head_entry(pos, head, member) \
pos = list_entry((head)->next, typeof(*pos), member)

static ssize_t
store_fc_private_host_tgtid_bind_type(struct class_device *cdev,
const char *buf, size_t count)
{
struct Scsi_Host *shost = transport_class_to_shost(cdev);
struct fc_rport *rport, *next_rport;
struct fc_rport *rport;
enum fc_tgtid_binding_type val;
unsigned long flags;

Expand All @@ -834,9 +837,13 @@ store_fc_private_host_tgtid_bind_type(struct class_device *cdev,
/* if changing bind type, purge all unused consistent bindings */
if (val != fc_host_tgtid_bind_type(shost)) {
spin_lock_irqsave(shost->host_lock, flags);
list_for_each_entry_safe(rport, next_rport,
&fc_host_rport_bindings(shost), peers)
while (!list_empty(&fc_host_rport_bindings(shost))) {
get_list_head_entry(rport,
&fc_host_rport_bindings(shost), peers);
spin_unlock_irqrestore(shost->host_lock, flags);
fc_rport_terminate(rport);
spin_lock_irqsave(shost->host_lock, flags);
}
spin_unlock_irqrestore(shost->host_lock, flags);
}

Expand Down

0 comments on commit e5cb079

Please sign in to comment.