mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
[SCSI] ch: Convert to use unlocked_ioctl
As of now, compat_ioctl already runs without the BKL, whereas ioctl runs with the BKL. This patch first converts changer_fops to use a .unlocked_ioctl member. It applies the same locking rationale than ch_ioctl_compat() uses to ch_ioctl(). Signed-off-by: Mathieu Segaud <mathieu.segaud@regala.cx> Reviewed-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
This commit is contained in:
parent
eaa3e22e8d
commit
f7fea185d2
@ -92,8 +92,7 @@ static int ch_probe(struct device *);
|
|||||||
static int ch_remove(struct device *);
|
static int ch_remove(struct device *);
|
||||||
static int ch_open(struct inode * inode, struct file * filp);
|
static int ch_open(struct inode * inode, struct file * filp);
|
||||||
static int ch_release(struct inode * inode, struct file * filp);
|
static int ch_release(struct inode * inode, struct file * filp);
|
||||||
static int ch_ioctl(struct inode * inode, struct file * filp,
|
static long ch_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
|
||||||
unsigned int cmd, unsigned long arg);
|
|
||||||
#ifdef CONFIG_COMPAT
|
#ifdef CONFIG_COMPAT
|
||||||
static long ch_ioctl_compat(struct file * filp,
|
static long ch_ioctl_compat(struct file * filp,
|
||||||
unsigned int cmd, unsigned long arg);
|
unsigned int cmd, unsigned long arg);
|
||||||
@ -133,7 +132,7 @@ static const struct file_operations changer_fops =
|
|||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = ch_open,
|
.open = ch_open,
|
||||||
.release = ch_release,
|
.release = ch_release,
|
||||||
.ioctl = ch_ioctl,
|
.unlocked_ioctl = ch_ioctl,
|
||||||
#ifdef CONFIG_COMPAT
|
#ifdef CONFIG_COMPAT
|
||||||
.compat_ioctl = ch_ioctl_compat,
|
.compat_ioctl = ch_ioctl_compat,
|
||||||
#endif
|
#endif
|
||||||
@ -626,7 +625,7 @@ ch_checkrange(scsi_changer *ch, unsigned int type, unsigned int unit)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ch_ioctl(struct inode * inode, struct file * file,
|
static long ch_ioctl(struct file *file,
|
||||||
unsigned int cmd, unsigned long arg)
|
unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
scsi_changer *ch = file->private_data;
|
scsi_changer *ch = file->private_data;
|
||||||
@ -887,8 +886,7 @@ static long ch_ioctl_compat(struct file * file,
|
|||||||
case CHIOINITELEM:
|
case CHIOINITELEM:
|
||||||
case CHIOSVOLTAG:
|
case CHIOSVOLTAG:
|
||||||
/* compatible */
|
/* compatible */
|
||||||
return ch_ioctl(NULL /* inode, unused */,
|
return ch_ioctl(file, cmd, arg);
|
||||||
file, cmd, arg);
|
|
||||||
case CHIOGSTATUS32:
|
case CHIOGSTATUS32:
|
||||||
{
|
{
|
||||||
struct changer_element_status32 ces32;
|
struct changer_element_status32 ces32;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user