Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98909
b: refs/heads/master
c: be1fd70
h: refs/heads/master
i:
  98907: 69f841a
v: v3
  • Loading branch information
Alan Cox authored and Jens Axboe committed Jul 4, 2008
1 parent 2ed791a commit a13eba6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 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: 823ed72e8fe566983b121e8cc3147dd50ce63a8a
refs/heads/master: be1fd70fea1100c57f3aa1934ebb93abc474e50c
20 changes: 11 additions & 9 deletions trunk/drivers/block/paride/pt.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ static int (*drives[4])[6] = {&drive0, &drive1, &drive2, &drive3};
#include <linux/mtio.h>
#include <linux/device.h>
#include <linux/sched.h> /* current, TASK_*, schedule_timeout() */
#include <linux/smp_lock.h>

#include <asm/uaccess.h>

Expand Down Expand Up @@ -189,8 +190,7 @@ module_param_array(drive3, int, NULL, 0);
#define ATAPI_LOG_SENSE 0x4d

static int pt_open(struct inode *inode, struct file *file);
static int pt_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg);
static long pt_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
static int pt_release(struct inode *inode, struct file *file);
static ssize_t pt_read(struct file *filp, char __user *buf,
size_t count, loff_t * ppos);
Expand Down Expand Up @@ -236,7 +236,7 @@ static const struct file_operations pt_fops = {
.owner = THIS_MODULE,
.read = pt_read,
.write = pt_write,
.ioctl = pt_ioctl,
.unlocked_ioctl = pt_ioctl,
.open = pt_open,
.release = pt_release,
};
Expand Down Expand Up @@ -685,8 +685,7 @@ static int pt_open(struct inode *inode, struct file *file)
return err;
}

static int pt_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
static long pt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct pt_unit *tape = file->private_data;
struct mtop __user *p = (void __user *)arg;
Expand All @@ -700,23 +699,26 @@ static int pt_ioctl(struct inode *inode, struct file *file,
switch (mtop.mt_op) {

case MTREW:
lock_kernel();
pt_rewind(tape);
unlock_kernel();
return 0;

case MTWEOF:
lock_kernel();
pt_write_fm(tape);
unlock_kernel();
return 0;

default:
printk("%s: Unimplemented mt_op %d\n", tape->name,
/* FIXME: rate limit ?? */
printk(KERN_DEBUG "%s: Unimplemented mt_op %d\n", tape->name,
mtop.mt_op);
return -EINVAL;
}

default:
printk("%s: Unimplemented ioctl 0x%x\n", tape->name, cmd);
return -EINVAL;

return -ENOTTY;
}
}

Expand Down

0 comments on commit a13eba6

Please sign in to comment.