diff options
-rw-r--r-- | drivers/scsi/st.c | 16 | ||||
-rw-r--r-- | drivers/scsi/st.h | 3 |
2 files changed, 10 insertions, 9 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); |
diff --git a/drivers/scsi/st.h b/drivers/scsi/st.h index 50f3deb1f9ed..6c8075712974 100644 --- a/drivers/scsi/st.h +++ b/drivers/scsi/st.h | |||
@@ -3,6 +3,7 @@ | |||
3 | #define _ST_H | 3 | #define _ST_H |
4 | 4 | ||
5 | #include <linux/completion.h> | 5 | #include <linux/completion.h> |
6 | #include <linux/mutex.h> | ||
6 | #include <linux/kref.h> | 7 | #include <linux/kref.h> |
7 | #include <scsi/scsi_cmnd.h> | 8 | #include <scsi/scsi_cmnd.h> |
8 | 9 | ||
@@ -98,7 +99,7 @@ struct st_partstat { | |||
98 | struct scsi_tape { | 99 | struct scsi_tape { |
99 | struct scsi_driver *driver; | 100 | struct scsi_driver *driver; |
100 | struct scsi_device *device; | 101 | struct scsi_device *device; |
101 | struct semaphore lock; /* For serialization */ | 102 | struct mutex lock; /* For serialization */ |
102 | struct completion wait; /* For SCSI commands */ | 103 | struct completion wait; /* For SCSI commands */ |
103 | struct st_buffer *buffer; | 104 | struct st_buffer *buffer; |
104 | 105 | ||