diff options
author | Matthias Kaehlcke <matthias.kaehlcke@gmail.com> | 2007-07-29 17:38:15 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-07-31 11:44:01 -0400 |
commit | 28f85009e0cf6a5232cd285131eac3dfe26d9e3a (patch) | |
tree | 7fbf47978234fc2cd92d4695f784a8bc15501edc /drivers/scsi/st.c | |
parent | 0c6a89ba640d28e1dcd7fd1a217d2cfb92ae4953 (diff) |
[SCSI] st: Use mutex instead of semaphore
The SCSI Tape driver uses a semaphore as mutex. Use the mutex API
instead of the (binary) semaphore.
Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Acked-by: Kai Makisara <kai.makisara@kolumbus.fi>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/st.c')
-rw-r--r-- | drivers/scsi/st.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index a4f7b8465773..73c44cbdea47 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c | |||
@@ -1485,7 +1485,7 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) | |||
1485 | struct st_buffer *STbp; | 1485 | struct st_buffer *STbp; |
1486 | char *name = tape_name(STp); | 1486 | char *name = tape_name(STp); |
1487 | 1487 | ||
1488 | if (down_interruptible(&STp->lock)) | 1488 | if (mutex_lock_interruptible(&STp->lock)) |
1489 | return -ERESTARTSYS; | 1489 | return -ERESTARTSYS; |
1490 | 1490 | ||
1491 | retval = rw_checks(STp, filp, count); | 1491 | retval = rw_checks(STp, filp, count); |
@@ -1736,7 +1736,7 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) | |||
1736 | if (SRpnt != NULL) | 1736 | if (SRpnt != NULL) |
1737 | st_release_request(SRpnt); | 1737 | st_release_request(SRpnt); |
1738 | release_buffering(STp, 0); | 1738 | release_buffering(STp, 0); |
1739 | up(&STp->lock); | 1739 | mutex_unlock(&STp->lock); |
1740 | 1740 | ||
1741 | return retval; | 1741 | return retval; |
1742 | } | 1742 | } |
@@ -1942,7 +1942,7 @@ st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) | |||
1942 | struct st_buffer *STbp = STp->buffer; | 1942 | struct st_buffer *STbp = STp->buffer; |
1943 | DEB( char *name = tape_name(STp); ) | 1943 | DEB( char *name = tape_name(STp); ) |
1944 | 1944 | ||
1945 | if (down_interruptible(&STp->lock)) | 1945 | if (mutex_lock_interruptible(&STp->lock)) |
1946 | return -ERESTARTSYS; | 1946 | return -ERESTARTSYS; |
1947 | 1947 | ||
1948 | retval = rw_checks(STp, filp, count); | 1948 | retval = rw_checks(STp, filp, count); |
@@ -2069,7 +2069,7 @@ st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) | |||
2069 | release_buffering(STp, 1); | 2069 | release_buffering(STp, 1); |
2070 | STbp->buffer_bytes = 0; | 2070 | STbp->buffer_bytes = 0; |
2071 | } | 2071 | } |
2072 | up(&STp->lock); | 2072 | mutex_unlock(&STp->lock); |
2073 | 2073 | ||
2074 | return retval; | 2074 | return retval; |
2075 | } | 2075 | } |
@@ -3226,7 +3226,7 @@ static int st_ioctl(struct inode *inode, struct file *file, | |||
3226 | char *name = tape_name(STp); | 3226 | char *name = tape_name(STp); |
3227 | void __user *p = (void __user *)arg; | 3227 | void __user *p = (void __user *)arg; |
3228 | 3228 | ||
3229 | if (down_interruptible(&STp->lock)) | 3229 | if (mutex_lock_interruptible(&STp->lock)) |
3230 | return -ERESTARTSYS; | 3230 | return -ERESTARTSYS; |
3231 | 3231 | ||
3232 | DEB( | 3232 | DEB( |
@@ -3537,7 +3537,7 @@ static int st_ioctl(struct inode *inode, struct file *file, | |||
3537 | retval = (-EFAULT); | 3537 | retval = (-EFAULT); |
3538 | goto out; | 3538 | goto out; |
3539 | } | 3539 | } |
3540 | up(&STp->lock); | 3540 | mutex_unlock(&STp->lock); |
3541 | switch (cmd_in) { | 3541 | switch (cmd_in) { |
3542 | case SCSI_IOCTL_GET_IDLUN: | 3542 | case SCSI_IOCTL_GET_IDLUN: |
3543 | case SCSI_IOCTL_GET_BUS_NUMBER: | 3543 | case SCSI_IOCTL_GET_BUS_NUMBER: |
@@ -3563,7 +3563,7 @@ static int st_ioctl(struct inode *inode, struct file *file, | |||
3563 | return retval; | 3563 | return retval; |
3564 | 3564 | ||
3565 | out: | 3565 | out: |
3566 | up(&STp->lock); | 3566 | mutex_unlock(&STp->lock); |
3567 | return retval; | 3567 | return retval; |
3568 | } | 3568 | } |
3569 | 3569 | ||
@@ -4029,7 +4029,7 @@ static int st_probe(struct device *dev) | |||
4029 | 4029 | ||
4030 | tpnt->density_changed = tpnt->compression_changed = | 4030 | tpnt->density_changed = tpnt->compression_changed = |
4031 | tpnt->blksize_changed = 0; | 4031 | tpnt->blksize_changed = 0; |
4032 | init_MUTEX(&tpnt->lock); | 4032 | mutex_init(&tpnt->lock); |
4033 | 4033 | ||
4034 | st_nr_dev++; | 4034 | st_nr_dev++; |
4035 | write_unlock(&st_dev_arr_lock); | 4035 | write_unlock(&st_dev_arr_lock); |