Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27609
b: refs/heads/master
c: b3589fd
h: refs/heads/master
i:
  27607: a4cbf0b
v: v3
  • Loading branch information
Matthew Wilcox authored and Roland Dreier committed Jun 18, 2006
1 parent 095f721 commit 5a1f0b7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 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: 549c5fc2c8149498118f2494a1b6a4938ca05985
refs/heads/master: b3589fd49067bab9fe0c60430860e6befbd5ba37
14 changes: 7 additions & 7 deletions trunk/drivers/infiniband/ulp/srp/ib_srp.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,9 @@ static void srp_remove_work(void *target_ptr)
target->state = SRP_TARGET_REMOVED;
spin_unlock_irq(target->scsi_host->host_lock);

mutex_lock(&target->srp_host->target_mutex);
spin_lock(&target->srp_host->target_lock);
list_del(&target->list);
mutex_unlock(&target->srp_host->target_mutex);
spin_unlock(&target->srp_host->target_lock);

scsi_remove_host(target->scsi_host);
ib_destroy_cm_id(target->cm_id);
Expand Down Expand Up @@ -1450,9 +1450,9 @@ static int srp_add_target(struct srp_host *host, struct srp_target_port *target)
if (scsi_add_host(target->scsi_host, host->dev->dev->dma_device))
return -ENODEV;

mutex_lock(&host->target_mutex);
spin_lock(&host->target_lock);
list_add_tail(&target->list, &host->target_list);
mutex_unlock(&host->target_mutex);
spin_unlock(&host->target_lock);

target->state = SRP_TARGET_LIVE;

Expand Down Expand Up @@ -1724,7 +1724,7 @@ static struct srp_host *srp_add_port(struct srp_device *device, u8 port)
return NULL;

INIT_LIST_HEAD(&host->target_list);
mutex_init(&host->target_mutex);
spin_lock_init(&host->target_lock);
init_completion(&host->released);
host->dev = device;
host->port = port;
Expand Down Expand Up @@ -1866,14 +1866,14 @@ static void srp_remove_one(struct ib_device *device)
* Mark all target ports as removed, so we stop queueing
* commands and don't try to reconnect.
*/
mutex_lock(&host->target_mutex);
spin_lock(&host->target_lock);
list_for_each_entry(target, &host->target_list, list) {
spin_lock_irqsave(target->scsi_host->host_lock, flags);
if (target->state != SRP_TARGET_REMOVED)
target->state = SRP_TARGET_REMOVED;
spin_unlock_irqrestore(target->scsi_host->host_lock, flags);
}
mutex_unlock(&host->target_mutex);
spin_unlock(&host->target_lock);

/*
* Wait for any reconnection tasks that may have
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/ulp/srp/ib_srp.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ struct srp_host {
u8 port;
struct class_device class_dev;
struct list_head target_list;
struct mutex target_mutex;
spinlock_t target_lock;
struct completion released;
struct list_head list;
};
Expand Down

0 comments on commit 5a1f0b7

Please sign in to comment.