aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/osst.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-06-16 12:08:13 -0400
committerJiri Kosina <jkosina@suse.cz>2010-06-16 12:08:13 -0400
commitf1bbbb6912662b9f6070c5bfc4ca9eb1f06a9d5b (patch)
treec2c130a74be25b0b2dff992e1a195e2728bdaadd /drivers/scsi/osst.c
parentfd0961ff67727482bb20ca7e8ea97b83e9de2ddb (diff)
parent7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff)
Merge branch 'master' into for-next
Diffstat (limited to 'drivers/scsi/osst.c')
-rw-r--r--drivers/scsi/osst.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index b219118f8bd6..d64b7178fa08 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -3587,7 +3587,7 @@ if (SRpnt) printk(KERN_ERR "%s:A: Not supposed to have SRpnt at line %d\n", name
3587 if (i == (-ENOSPC)) { 3587 if (i == (-ENOSPC)) {
3588 transfer = STp->buffer->writing; /* FIXME -- check this logic */ 3588 transfer = STp->buffer->writing; /* FIXME -- check this logic */
3589 if (transfer <= do_count) { 3589 if (transfer <= do_count) {
3590 filp->f_pos += do_count - transfer; 3590 *ppos += do_count - transfer;
3591 count -= do_count - transfer; 3591 count -= do_count - transfer;
3592 if (STps->drv_block >= 0) { 3592 if (STps->drv_block >= 0) {
3593 STps->drv_block += (do_count - transfer) / STp->block_size; 3593 STps->drv_block += (do_count - transfer) / STp->block_size;
@@ -3625,7 +3625,7 @@ if (SRpnt) printk(KERN_ERR "%s:A: Not supposed to have SRpnt at line %d\n", name
3625 goto out; 3625 goto out;
3626 } 3626 }
3627 3627
3628 filp->f_pos += do_count; 3628 *ppos += do_count;
3629 b_point += do_count; 3629 b_point += do_count;
3630 count -= do_count; 3630 count -= do_count;
3631 if (STps->drv_block >= 0) { 3631 if (STps->drv_block >= 0) {
@@ -3647,7 +3647,7 @@ if (SRpnt) printk(KERN_ERR "%s:A: Not supposed to have SRpnt at line %d\n", name
3647 if (STps->drv_block >= 0) { 3647 if (STps->drv_block >= 0) {
3648 STps->drv_block += blks; 3648 STps->drv_block += blks;
3649 } 3649 }
3650 filp->f_pos += count; 3650 *ppos += count;
3651 count = 0; 3651 count = 0;
3652 } 3652 }
3653 3653
@@ -3823,7 +3823,7 @@ static ssize_t osst_read(struct file * filp, char __user * buf, size_t count, lo
3823 } 3823 }
3824 STp->logical_blk_num += transfer / STp->block_size; 3824 STp->logical_blk_num += transfer / STp->block_size;
3825 STps->drv_block += transfer / STp->block_size; 3825 STps->drv_block += transfer / STp->block_size;
3826 filp->f_pos += transfer; 3826 *ppos += transfer;
3827 buf += transfer; 3827 buf += transfer;
3828 total += transfer; 3828 total += transfer;
3829 } 3829 }
@@ -4932,7 +4932,7 @@ static int os_scsi_tape_close(struct inode * inode, struct file * filp)
4932 4932
4933 4933
4934/* The ioctl command */ 4934/* The ioctl command */
4935static int osst_ioctl(struct inode * inode,struct file * file, 4935static long osst_ioctl(struct file * file,
4936 unsigned int cmd_in, unsigned long arg) 4936 unsigned int cmd_in, unsigned long arg)
4937{ 4937{
4938 int i, cmd_nr, cmd_type, blk, retval = 0; 4938 int i, cmd_nr, cmd_type, blk, retval = 0;
@@ -4943,8 +4943,11 @@ static int osst_ioctl(struct inode * inode,struct file * file,
4943 char * name = tape_name(STp); 4943 char * name = tape_name(STp);
4944 void __user * p = (void __user *)arg; 4944 void __user * p = (void __user *)arg;
4945 4945
4946 if (mutex_lock_interruptible(&STp->lock)) 4946 lock_kernel();
4947 if (mutex_lock_interruptible(&STp->lock)) {
4948 unlock_kernel();
4947 return -ERESTARTSYS; 4949 return -ERESTARTSYS;
4950 }
4948 4951
4949#if DEBUG 4952#if DEBUG
4950 if (debugging && !STp->in_use) { 4953 if (debugging && !STp->in_use) {
@@ -5256,12 +5259,15 @@ static int osst_ioctl(struct inode * inode,struct file * file,
5256 5259
5257 mutex_unlock(&STp->lock); 5260 mutex_unlock(&STp->lock);
5258 5261
5259 return scsi_ioctl(STp->device, cmd_in, p); 5262 retval = scsi_ioctl(STp->device, cmd_in, p);
5263 unlock_kernel();
5264 return retval;
5260 5265
5261out: 5266out:
5262 if (SRpnt) osst_release_request(SRpnt); 5267 if (SRpnt) osst_release_request(SRpnt);
5263 5268
5264 mutex_unlock(&STp->lock); 5269 mutex_unlock(&STp->lock);
5270 unlock_kernel();
5265 5271
5266 return retval; 5272 return retval;
5267} 5273}
@@ -5613,13 +5619,14 @@ static const struct file_operations osst_fops = {
5613 .owner = THIS_MODULE, 5619 .owner = THIS_MODULE,
5614 .read = osst_read, 5620 .read = osst_read,
5615 .write = osst_write, 5621 .write = osst_write,
5616 .ioctl = osst_ioctl, 5622 .unlocked_ioctl = osst_ioctl,
5617#ifdef CONFIG_COMPAT 5623#ifdef CONFIG_COMPAT
5618 .compat_ioctl = osst_compat_ioctl, 5624 .compat_ioctl = osst_compat_ioctl,
5619#endif 5625#endif
5620 .open = os_scsi_tape_open, 5626 .open = os_scsi_tape_open,
5621 .flush = os_scsi_tape_flush, 5627 .flush = os_scsi_tape_flush,
5622 .release = os_scsi_tape_close, 5628 .release = os_scsi_tape_close,
5629 .llseek = noop_llseek,
5623}; 5630};
5624 5631
5625static int osst_supports(struct scsi_device * SDp) 5632static int osst_supports(struct scsi_device * SDp)