Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19307
b: refs/heads/master
c: 8e9e5f4
h: refs/heads/master
i:
  19305: f2a9472
  19303: 7357cae
v: v3
  • Loading branch information
Ingo Molnar authored and Roland Dreier committed Jan 30, 2006
1 parent 558c04f commit 397a9cb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 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: cbd2981a97cb628431a987a8abd1731c74bcc32e
refs/heads/master: 8e9e5f4f5eb1d44ddabfd1ddea4ca4e4244a9ffb
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 @@ -357,9 +357,9 @@ static void srp_remove_work(void *target_ptr)
target->state = SRP_TARGET_REMOVED;
spin_unlock_irq(target->scsi_host->host_lock);

down(&target->srp_host->target_mutex);
mutex_lock(&target->srp_host->target_mutex);
list_del(&target->list);
up(&target->srp_host->target_mutex);
mutex_unlock(&target->srp_host->target_mutex);

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

down(&host->target_mutex);
mutex_lock(&host->target_mutex);
list_add_tail(&target->list, &host->target_list);
up(&host->target_mutex);
mutex_unlock(&host->target_mutex);

target->state = SRP_TARGET_LIVE;

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

INIT_LIST_HEAD(&host->target_list);
init_MUTEX(&host->target_mutex);
mutex_init(&host->target_mutex);
init_completion(&host->released);
host->dev = device;
host->port = port;
Expand Down Expand Up @@ -1626,15 +1626,15 @@ 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.
*/
down(&host->target_mutex);
mutex_lock(&host->target_mutex);
list_for_each_entry_safe(target, tmp_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);
}
up(&host->target_mutex);
mutex_unlock(&host->target_mutex);

/*
* Wait for any reconnection tasks that may have
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/infiniband/ulp/srp/ib_srp.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@

#include <linux/types.h>
#include <linux/list.h>

#include <asm/semaphore.h>
#include <linux/mutex.h>

#include <scsi/scsi_host.h>
#include <scsi/scsi_cmnd.h>
Expand Down Expand Up @@ -85,7 +84,7 @@ struct srp_host {
struct ib_mr *mr;
struct class_device class_dev;
struct list_head target_list;
struct semaphore target_mutex;
struct mutex target_mutex;
struct completion released;
struct list_head list;
};
Expand Down

0 comments on commit 397a9cb

Please sign in to comment.