Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23039
b: refs/heads/master
c: e723ccd
h: refs/heads/master
i:
  23037: bc69c3d
  23035: ecbef91
  23031: 6605702
  23023: a946e18
  23007: 5b74a81
  22975: ba9f6bd
  22911: 9e447b0
  22783: ff4af8d
  22527: 39c72ef
v: v3
  • Loading branch information
Jes Sorensen authored and Linus Torvalds committed Mar 23, 2006
1 parent 436035d commit 54509ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 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: 8ed965d612d9e9bc08805c75123f063cf6966311
refs/heads/master: e723ccd805857a46d3b63fbd20edea8579c6c541
11 changes: 6 additions & 5 deletions trunk/drivers/scsi/ide-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <linux/ide.h>
#include <linux/scatterlist.h>
#include <linux/delay.h>
#include <linux/mutex.h>

#include <asm/io.h>
#include <asm/bitops.h>
Expand Down Expand Up @@ -109,7 +110,7 @@ typedef struct ide_scsi_obj {
unsigned long log; /* log flags */
} idescsi_scsi_t;

static DECLARE_MUTEX(idescsi_ref_sem);
static DEFINE_MUTEX(idescsi_ref_mutex);

#define ide_scsi_g(disk) \
container_of((disk)->private_data, struct ide_scsi_obj, driver)
Expand All @@ -118,19 +119,19 @@ static struct ide_scsi_obj *ide_scsi_get(struct gendisk *disk)
{
struct ide_scsi_obj *scsi = NULL;

down(&idescsi_ref_sem);
mutex_lock(&idescsi_ref_mutex);
scsi = ide_scsi_g(disk);
if (scsi)
scsi_host_get(scsi->host);
up(&idescsi_ref_sem);
mutex_unlock(&idescsi_ref_mutex);
return scsi;
}

static void ide_scsi_put(struct ide_scsi_obj *scsi)
{
down(&idescsi_ref_sem);
mutex_lock(&idescsi_ref_mutex);
scsi_host_put(scsi->host);
up(&idescsi_ref_sem);
mutex_unlock(&idescsi_ref_mutex);
}

static inline idescsi_scsi_t *scsihost_to_idescsi(struct Scsi_Host *host)
Expand Down

0 comments on commit 54509ae

Please sign in to comment.