diff options
author | Mathieu Segaud <mathieu.segaud@regala.cx> | 2008-01-14 09:43:18 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-23 12:29:28 -0500 |
commit | f7fea185d2998dc4c902ec47834ab6db28fe0029 (patch) | |
tree | fdcbd91c4007ac3f4a7b98f2410f7eba546d5cb5 /drivers | |
parent | eaa3e22e8d32bf7a6176f04efad90f4a5aa67f58 (diff) |
[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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/ch.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 2311019304c0..cead0f5379c5 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c | |||
@@ -92,8 +92,7 @@ static int ch_probe(struct device *); | |||
92 | static int ch_remove(struct device *); | 92 | static int ch_remove(struct device *); |
93 | static int ch_open(struct inode * inode, struct file * filp); | 93 | static int ch_open(struct inode * inode, struct file * filp); |
94 | static int ch_release(struct inode * inode, struct file * filp); | 94 | static int ch_release(struct inode * inode, struct file * filp); |
95 | static int ch_ioctl(struct inode * inode, struct file * filp, | 95 | static long ch_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); |
96 | unsigned int cmd, unsigned long arg); | ||
97 | #ifdef CONFIG_COMPAT | 96 | #ifdef CONFIG_COMPAT |
98 | static long ch_ioctl_compat(struct file * filp, | 97 | static long ch_ioctl_compat(struct file * filp, |
99 | unsigned int cmd, unsigned long arg); | 98 | unsigned int cmd, unsigned long arg); |
@@ -130,12 +129,12 @@ static struct scsi_driver ch_template = | |||
130 | 129 | ||
131 | static const struct file_operations changer_fops = | 130 | static const struct file_operations changer_fops = |
132 | { | 131 | { |
133 | .owner = THIS_MODULE, | 132 | .owner = THIS_MODULE, |
134 | .open = ch_open, | 133 | .open = ch_open, |
135 | .release = ch_release, | 134 | .release = ch_release, |
136 | .ioctl = ch_ioctl, | 135 | .unlocked_ioctl = ch_ioctl, |
137 | #ifdef CONFIG_COMPAT | 136 | #ifdef CONFIG_COMPAT |
138 | .compat_ioctl = ch_ioctl_compat, | 137 | .compat_ioctl = ch_ioctl_compat, |
139 | #endif | 138 | #endif |
140 | }; | 139 | }; |
141 | 140 | ||
@@ -626,7 +625,7 @@ ch_checkrange(scsi_changer *ch, unsigned int type, unsigned int unit) | |||
626 | return 0; | 625 | return 0; |
627 | } | 626 | } |
628 | 627 | ||
629 | static int ch_ioctl(struct inode * inode, struct file * file, | 628 | static long ch_ioctl(struct file *file, |
630 | unsigned int cmd, unsigned long arg) | 629 | unsigned int cmd, unsigned long arg) |
631 | { | 630 | { |
632 | scsi_changer *ch = file->private_data; | 631 | scsi_changer *ch = file->private_data; |
@@ -887,8 +886,7 @@ static long ch_ioctl_compat(struct file * file, | |||
887 | case CHIOINITELEM: | 886 | case CHIOINITELEM: |
888 | case CHIOSVOLTAG: | 887 | case CHIOSVOLTAG: |
889 | /* compatible */ | 888 | /* compatible */ |
890 | return ch_ioctl(NULL /* inode, unused */, | 889 | return ch_ioctl(file, cmd, arg); |
891 | file, cmd, arg); | ||
892 | case CHIOGSTATUS32: | 890 | case CHIOGSTATUS32: |
893 | { | 891 | { |
894 | struct changer_element_status32 ces32; | 892 | struct changer_element_status32 ces32; |