diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-24 11:01:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-24 11:01:10 -0400 |
commit | f13771187b9423b824f32518319f6da85d819003 (patch) | |
tree | c431cf16c286065a302d5f3fb43fc1abac7e4047 /drivers | |
parent | 15953654cc312429740fd58fb37a5a3d63a54376 (diff) | |
parent | 9f37af654fda88a8dcca74c785f6c20e52758866 (diff) |
Merge branch 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing
* 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing:
uml: Pushdown the bkl from harddog_kern ioctl
sunrpc: Pushdown the bkl from sunrpc cache ioctl
sunrpc: Pushdown the bkl from ioctl
autofs4: Pushdown the bkl from ioctl
uml: Convert to unlocked_ioctls to remove implicit BKL
ncpfs: BKL ioctl pushdown
coda: Clean-up whitespace problems in pioctl.c
coda: BKL ioctl pushdown
drivers: Push down BKL into various drivers
isdn: Push down BKL into ioctl functions
scsi: Push down BKL into ioctl functions
dvb: Push down BKL into ioctl functions
smbfs: Push down BKL into ioctl function
coda/psdev: Remove BKL from ioctl function
um/mmapper: Remove BKL usage
sn_hwperf: Kill BKL usage
hfsplus: Push down BKL into ioctl function
Diffstat (limited to 'drivers')
47 files changed, 520 insertions, 219 deletions
diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c index 4f568cb9af3f..033e1505fca9 100644 --- a/drivers/char/apm-emulation.c +++ b/drivers/char/apm-emulation.c | |||
@@ -265,8 +265,8 @@ static unsigned int apm_poll(struct file *fp, poll_table * wait) | |||
265 | * Only when everyone who has opened /dev/apm_bios with write permission | 265 | * Only when everyone who has opened /dev/apm_bios with write permission |
266 | * has acknowledge does the actual suspend happen. | 266 | * has acknowledge does the actual suspend happen. |
267 | */ | 267 | */ |
268 | static int | 268 | static long |
269 | apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg) | 269 | apm_ioctl(struct file *filp, u_int cmd, u_long arg) |
270 | { | 270 | { |
271 | struct apm_user *as = filp->private_data; | 271 | struct apm_user *as = filp->private_data; |
272 | int err = -EINVAL; | 272 | int err = -EINVAL; |
@@ -274,6 +274,7 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg) | |||
274 | if (!as->suser || !as->writer) | 274 | if (!as->suser || !as->writer) |
275 | return -EPERM; | 275 | return -EPERM; |
276 | 276 | ||
277 | lock_kernel(); | ||
277 | switch (cmd) { | 278 | switch (cmd) { |
278 | case APM_IOC_SUSPEND: | 279 | case APM_IOC_SUSPEND: |
279 | mutex_lock(&state_lock); | 280 | mutex_lock(&state_lock); |
@@ -334,6 +335,7 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg) | |||
334 | mutex_unlock(&state_lock); | 335 | mutex_unlock(&state_lock); |
335 | break; | 336 | break; |
336 | } | 337 | } |
338 | unlock_kernel(); | ||
337 | 339 | ||
338 | return err; | 340 | return err; |
339 | } | 341 | } |
@@ -397,7 +399,7 @@ static const struct file_operations apm_bios_fops = { | |||
397 | .owner = THIS_MODULE, | 399 | .owner = THIS_MODULE, |
398 | .read = apm_read, | 400 | .read = apm_read, |
399 | .poll = apm_poll, | 401 | .poll = apm_poll, |
400 | .ioctl = apm_ioctl, | 402 | .unlocked_ioctl = apm_ioctl, |
401 | .open = apm_open, | 403 | .open = apm_open, |
402 | .release = apm_release, | 404 | .release = apm_release, |
403 | }; | 405 | }; |
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c index a7424bf7eacf..63313a33ba5f 100644 --- a/drivers/char/applicom.c +++ b/drivers/char/applicom.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/errno.h> | 28 | #include <linux/errno.h> |
29 | #include <linux/smp_lock.h> | ||
29 | #include <linux/miscdevice.h> | 30 | #include <linux/miscdevice.h> |
30 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
31 | #include <linux/wait.h> | 32 | #include <linux/wait.h> |
@@ -106,8 +107,7 @@ static unsigned int DeviceErrorCount; /* number of device error */ | |||
106 | 107 | ||
107 | static ssize_t ac_read (struct file *, char __user *, size_t, loff_t *); | 108 | static ssize_t ac_read (struct file *, char __user *, size_t, loff_t *); |
108 | static ssize_t ac_write (struct file *, const char __user *, size_t, loff_t *); | 109 | static ssize_t ac_write (struct file *, const char __user *, size_t, loff_t *); |
109 | static int ac_ioctl(struct inode *, struct file *, unsigned int, | 110 | static long ac_ioctl(struct file *, unsigned int, unsigned long); |
110 | unsigned long); | ||
111 | static irqreturn_t ac_interrupt(int, void *); | 111 | static irqreturn_t ac_interrupt(int, void *); |
112 | 112 | ||
113 | static const struct file_operations ac_fops = { | 113 | static const struct file_operations ac_fops = { |
@@ -115,7 +115,7 @@ static const struct file_operations ac_fops = { | |||
115 | .llseek = no_llseek, | 115 | .llseek = no_llseek, |
116 | .read = ac_read, | 116 | .read = ac_read, |
117 | .write = ac_write, | 117 | .write = ac_write, |
118 | .ioctl = ac_ioctl, | 118 | .unlocked_ioctl = ac_ioctl, |
119 | }; | 119 | }; |
120 | 120 | ||
121 | static struct miscdevice ac_miscdev = { | 121 | static struct miscdevice ac_miscdev = { |
@@ -689,7 +689,7 @@ static irqreturn_t ac_interrupt(int vec, void *dev_instance) | |||
689 | 689 | ||
690 | 690 | ||
691 | 691 | ||
692 | static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 692 | static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
693 | 693 | ||
694 | { /* @ ADG ou ATO selon le cas */ | 694 | { /* @ ADG ou ATO selon le cas */ |
695 | int i; | 695 | int i; |
@@ -711,7 +711,8 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un | |||
711 | kfree(adgl); | 711 | kfree(adgl); |
712 | return -EFAULT; | 712 | return -EFAULT; |
713 | } | 713 | } |
714 | 714 | ||
715 | lock_kernel(); | ||
715 | IndexCard = adgl->num_card-1; | 716 | IndexCard = adgl->num_card-1; |
716 | 717 | ||
717 | if(cmd != 6 && ((IndexCard >= MAX_BOARD) || !apbs[IndexCard].RamIO)) { | 718 | if(cmd != 6 && ((IndexCard >= MAX_BOARD) || !apbs[IndexCard].RamIO)) { |
@@ -721,6 +722,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un | |||
721 | warncount--; | 722 | warncount--; |
722 | } | 723 | } |
723 | kfree(adgl); | 724 | kfree(adgl); |
725 | unlock_kernel(); | ||
724 | return -EINVAL; | 726 | return -EINVAL; |
725 | } | 727 | } |
726 | 728 | ||
@@ -838,6 +840,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un | |||
838 | } | 840 | } |
839 | Dummy = readb(apbs[IndexCard].RamIO + VERS); | 841 | Dummy = readb(apbs[IndexCard].RamIO + VERS); |
840 | kfree(adgl); | 842 | kfree(adgl); |
843 | unlock_kernel(); | ||
841 | return 0; | 844 | return 0; |
842 | } | 845 | } |
843 | 846 | ||
diff --git a/drivers/char/ds1620.c b/drivers/char/ds1620.c index 61f0146e215d..dbee8688f75c 100644 --- a/drivers/char/ds1620.c +++ b/drivers/char/ds1620.c | |||
@@ -232,7 +232,7 @@ ds1620_read(struct file *file, char __user *buf, size_t count, loff_t *ptr) | |||
232 | } | 232 | } |
233 | 233 | ||
234 | static int | 234 | static int |
235 | ds1620_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 235 | ds1620_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
236 | { | 236 | { |
237 | struct therm therm; | 237 | struct therm therm; |
238 | union { | 238 | union { |
@@ -316,6 +316,18 @@ ds1620_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned | |||
316 | return 0; | 316 | return 0; |
317 | } | 317 | } |
318 | 318 | ||
319 | static long | ||
320 | ds1620_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
321 | { | ||
322 | int ret; | ||
323 | |||
324 | lock_kernel(); | ||
325 | ret = ds1620_ioctl(file, cmd, arg); | ||
326 | unlock_kernel(); | ||
327 | |||
328 | return ret; | ||
329 | } | ||
330 | |||
319 | #ifdef THERM_USE_PROC | 331 | #ifdef THERM_USE_PROC |
320 | static int | 332 | static int |
321 | proc_therm_ds1620_read(char *buf, char **start, off_t offset, | 333 | proc_therm_ds1620_read(char *buf, char **start, off_t offset, |
@@ -344,7 +356,7 @@ static const struct file_operations ds1620_fops = { | |||
344 | .owner = THIS_MODULE, | 356 | .owner = THIS_MODULE, |
345 | .open = ds1620_open, | 357 | .open = ds1620_open, |
346 | .read = ds1620_read, | 358 | .read = ds1620_read, |
347 | .ioctl = ds1620_ioctl, | 359 | .unlocked_ioctl = ds1620_unlocked_ioctl, |
348 | }; | 360 | }; |
349 | 361 | ||
350 | static struct miscdevice ds1620_miscdev = { | 362 | static struct miscdevice ds1620_miscdev = { |
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c index 045c930e6320..e3859d4eaead 100644 --- a/drivers/char/dtlk.c +++ b/drivers/char/dtlk.c | |||
@@ -93,8 +93,8 @@ static ssize_t dtlk_write(struct file *, const char __user *, | |||
93 | static unsigned int dtlk_poll(struct file *, poll_table *); | 93 | static unsigned int dtlk_poll(struct file *, poll_table *); |
94 | static int dtlk_open(struct inode *, struct file *); | 94 | static int dtlk_open(struct inode *, struct file *); |
95 | static int dtlk_release(struct inode *, struct file *); | 95 | static int dtlk_release(struct inode *, struct file *); |
96 | static int dtlk_ioctl(struct inode *inode, struct file *file, | 96 | static long dtlk_ioctl(struct file *file, |
97 | unsigned int cmd, unsigned long arg); | 97 | unsigned int cmd, unsigned long arg); |
98 | 98 | ||
99 | static const struct file_operations dtlk_fops = | 99 | static const struct file_operations dtlk_fops = |
100 | { | 100 | { |
@@ -102,7 +102,7 @@ static const struct file_operations dtlk_fops = | |||
102 | .read = dtlk_read, | 102 | .read = dtlk_read, |
103 | .write = dtlk_write, | 103 | .write = dtlk_write, |
104 | .poll = dtlk_poll, | 104 | .poll = dtlk_poll, |
105 | .ioctl = dtlk_ioctl, | 105 | .unlocked_ioctl = dtlk_ioctl, |
106 | .open = dtlk_open, | 106 | .open = dtlk_open, |
107 | .release = dtlk_release, | 107 | .release = dtlk_release, |
108 | }; | 108 | }; |
@@ -263,10 +263,9 @@ static void dtlk_timer_tick(unsigned long data) | |||
263 | wake_up_interruptible(&dtlk_process_list); | 263 | wake_up_interruptible(&dtlk_process_list); |
264 | } | 264 | } |
265 | 265 | ||
266 | static int dtlk_ioctl(struct inode *inode, | 266 | static long dtlk_ioctl(struct file *file, |
267 | struct file *file, | 267 | unsigned int cmd, |
268 | unsigned int cmd, | 268 | unsigned long arg) |
269 | unsigned long arg) | ||
270 | { | 269 | { |
271 | char __user *argp = (char __user *)arg; | 270 | char __user *argp = (char __user *)arg; |
272 | struct dtlk_settings *sp; | 271 | struct dtlk_settings *sp; |
@@ -276,7 +275,9 @@ static int dtlk_ioctl(struct inode *inode, | |||
276 | switch (cmd) { | 275 | switch (cmd) { |
277 | 276 | ||
278 | case DTLK_INTERROGATE: | 277 | case DTLK_INTERROGATE: |
278 | lock_kernel(); | ||
279 | sp = dtlk_interrogate(); | 279 | sp = dtlk_interrogate(); |
280 | unlock_kernel(); | ||
280 | if (copy_to_user(argp, sp, sizeof(struct dtlk_settings))) | 281 | if (copy_to_user(argp, sp, sizeof(struct dtlk_settings))) |
281 | return -EINVAL; | 282 | return -EINVAL; |
282 | return 0; | 283 | return 0; |
diff --git a/drivers/char/generic_nvram.c b/drivers/char/generic_nvram.c index fda4181b5e67..82b5a88a82d7 100644 --- a/drivers/char/generic_nvram.c +++ b/drivers/char/generic_nvram.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/miscdevice.h> | 19 | #include <linux/miscdevice.h> |
20 | #include <linux/fcntl.h> | 20 | #include <linux/fcntl.h> |
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/smp_lock.h> | ||
22 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
23 | #include <asm/nvram.h> | 24 | #include <asm/nvram.h> |
24 | #ifdef CONFIG_PPC_PMAC | 25 | #ifdef CONFIG_PPC_PMAC |
@@ -84,8 +85,7 @@ static ssize_t write_nvram(struct file *file, const char __user *buf, | |||
84 | return p - buf; | 85 | return p - buf; |
85 | } | 86 | } |
86 | 87 | ||
87 | static int nvram_ioctl(struct inode *inode, struct file *file, | 88 | static int nvram_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
88 | unsigned int cmd, unsigned long arg) | ||
89 | { | 89 | { |
90 | switch(cmd) { | 90 | switch(cmd) { |
91 | #ifdef CONFIG_PPC_PMAC | 91 | #ifdef CONFIG_PPC_PMAC |
@@ -116,12 +116,23 @@ static int nvram_ioctl(struct inode *inode, struct file *file, | |||
116 | return 0; | 116 | return 0; |
117 | } | 117 | } |
118 | 118 | ||
119 | static long nvram_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
120 | { | ||
121 | int ret; | ||
122 | |||
123 | lock_kernel(); | ||
124 | ret = nvram_ioctl(file, cmd, arg); | ||
125 | unlock_kernel(); | ||
126 | |||
127 | return ret; | ||
128 | } | ||
129 | |||
119 | const struct file_operations nvram_fops = { | 130 | const struct file_operations nvram_fops = { |
120 | .owner = THIS_MODULE, | 131 | .owner = THIS_MODULE, |
121 | .llseek = nvram_llseek, | 132 | .llseek = nvram_llseek, |
122 | .read = read_nvram, | 133 | .read = read_nvram, |
123 | .write = write_nvram, | 134 | .write = write_nvram, |
124 | .ioctl = nvram_ioctl, | 135 | .unlocked_ioctl = nvram_unlocked_ioctl, |
125 | }; | 136 | }; |
126 | 137 | ||
127 | static struct miscdevice nvram_dev = { | 138 | static struct miscdevice nvram_dev = { |
diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c index 31e7c91c2d9d..b6c2cc167c11 100644 --- a/drivers/char/genrtc.c +++ b/drivers/char/genrtc.c | |||
@@ -262,7 +262,7 @@ static inline int gen_set_rtc_irq_bit(unsigned char bit) | |||
262 | #endif | 262 | #endif |
263 | } | 263 | } |
264 | 264 | ||
265 | static int gen_rtc_ioctl(struct inode *inode, struct file *file, | 265 | static int gen_rtc_ioctl(struct file *file, |
266 | unsigned int cmd, unsigned long arg) | 266 | unsigned int cmd, unsigned long arg) |
267 | { | 267 | { |
268 | struct rtc_time wtime; | 268 | struct rtc_time wtime; |
@@ -332,6 +332,18 @@ static int gen_rtc_ioctl(struct inode *inode, struct file *file, | |||
332 | return -EINVAL; | 332 | return -EINVAL; |
333 | } | 333 | } |
334 | 334 | ||
335 | static long gen_rtc_unlocked_ioctl(struct file *file, unsigned int cmd, | ||
336 | unsigned long arg) | ||
337 | { | ||
338 | int ret; | ||
339 | |||
340 | lock_kernel(); | ||
341 | ret = gen_rtc_ioctl(file, cmd, arg); | ||
342 | unlock_kernel(); | ||
343 | |||
344 | return ret; | ||
345 | } | ||
346 | |||
335 | /* | 347 | /* |
336 | * We enforce only one user at a time here with the open/close. | 348 | * We enforce only one user at a time here with the open/close. |
337 | * Also clear the previous interrupt data on an open, and clean | 349 | * Also clear the previous interrupt data on an open, and clean |
@@ -482,7 +494,7 @@ static const struct file_operations gen_rtc_fops = { | |||
482 | .read = gen_rtc_read, | 494 | .read = gen_rtc_read, |
483 | .poll = gen_rtc_poll, | 495 | .poll = gen_rtc_poll, |
484 | #endif | 496 | #endif |
485 | .ioctl = gen_rtc_ioctl, | 497 | .unlocked_ioctl = gen_rtc_unlocked_ioctl, |
486 | .open = gen_rtc_open, | 498 | .open = gen_rtc_open, |
487 | .release = gen_rtc_release, | 499 | .release = gen_rtc_release, |
488 | }; | 500 | }; |
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 9ded667625ac..a0a1829d3198 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
@@ -431,14 +431,18 @@ static int hpet_release(struct inode *inode, struct file *file) | |||
431 | 431 | ||
432 | static int hpet_ioctl_common(struct hpet_dev *, int, unsigned long, int); | 432 | static int hpet_ioctl_common(struct hpet_dev *, int, unsigned long, int); |
433 | 433 | ||
434 | static int | 434 | static long hpet_ioctl(struct file *file, unsigned int cmd, |
435 | hpet_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | 435 | unsigned long arg) |
436 | unsigned long arg) | ||
437 | { | 436 | { |
438 | struct hpet_dev *devp; | 437 | struct hpet_dev *devp; |
438 | int ret; | ||
439 | 439 | ||
440 | devp = file->private_data; | 440 | devp = file->private_data; |
441 | return hpet_ioctl_common(devp, cmd, arg, 0); | 441 | lock_kernel(); |
442 | ret = hpet_ioctl_common(devp, cmd, arg, 0); | ||
443 | unlock_kernel(); | ||
444 | |||
445 | return ret; | ||
442 | } | 446 | } |
443 | 447 | ||
444 | static int hpet_ioctl_ieon(struct hpet_dev *devp) | 448 | static int hpet_ioctl_ieon(struct hpet_dev *devp) |
@@ -654,7 +658,7 @@ static const struct file_operations hpet_fops = { | |||
654 | .llseek = no_llseek, | 658 | .llseek = no_llseek, |
655 | .read = hpet_read, | 659 | .read = hpet_read, |
656 | .poll = hpet_poll, | 660 | .poll = hpet_poll, |
657 | .ioctl = hpet_ioctl, | 661 | .unlocked_ioctl = hpet_ioctl, |
658 | .open = hpet_open, | 662 | .open = hpet_open, |
659 | .release = hpet_release, | 663 | .release = hpet_release, |
660 | .fasync = hpet_fasync, | 664 | .fasync = hpet_fasync, |
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c index 65545de3dbf4..d8ec92a38980 100644 --- a/drivers/char/ipmi/ipmi_devintf.c +++ b/drivers/char/ipmi/ipmi_devintf.c | |||
@@ -228,8 +228,7 @@ static int handle_send_req(ipmi_user_t user, | |||
228 | return rv; | 228 | return rv; |
229 | } | 229 | } |
230 | 230 | ||
231 | static int ipmi_ioctl(struct inode *inode, | 231 | static int ipmi_ioctl(struct file *file, |
232 | struct file *file, | ||
233 | unsigned int cmd, | 232 | unsigned int cmd, |
234 | unsigned long data) | 233 | unsigned long data) |
235 | { | 234 | { |
@@ -630,6 +629,23 @@ static int ipmi_ioctl(struct inode *inode, | |||
630 | return rv; | 629 | return rv; |
631 | } | 630 | } |
632 | 631 | ||
632 | /* | ||
633 | * Note: it doesn't make sense to take the BKL here but | ||
634 | * not in compat_ipmi_ioctl. -arnd | ||
635 | */ | ||
636 | static long ipmi_unlocked_ioctl(struct file *file, | ||
637 | unsigned int cmd, | ||
638 | unsigned long data) | ||
639 | { | ||
640 | int ret; | ||
641 | |||
642 | lock_kernel(); | ||
643 | ret = ipmi_ioctl(file, cmd, data); | ||
644 | unlock_kernel(); | ||
645 | |||
646 | return ret; | ||
647 | } | ||
648 | |||
633 | #ifdef CONFIG_COMPAT | 649 | #ifdef CONFIG_COMPAT |
634 | 650 | ||
635 | /* | 651 | /* |
@@ -802,7 +818,7 @@ static long compat_ipmi_ioctl(struct file *filep, unsigned int cmd, | |||
802 | if (copy_to_user(precv64, &recv64, sizeof(recv64))) | 818 | if (copy_to_user(precv64, &recv64, sizeof(recv64))) |
803 | return -EFAULT; | 819 | return -EFAULT; |
804 | 820 | ||
805 | rc = ipmi_ioctl(filep->f_path.dentry->d_inode, filep, | 821 | rc = ipmi_ioctl(filep, |
806 | ((cmd == COMPAT_IPMICTL_RECEIVE_MSG) | 822 | ((cmd == COMPAT_IPMICTL_RECEIVE_MSG) |
807 | ? IPMICTL_RECEIVE_MSG | 823 | ? IPMICTL_RECEIVE_MSG |
808 | : IPMICTL_RECEIVE_MSG_TRUNC), | 824 | : IPMICTL_RECEIVE_MSG_TRUNC), |
@@ -819,14 +835,14 @@ static long compat_ipmi_ioctl(struct file *filep, unsigned int cmd, | |||
819 | return rc; | 835 | return rc; |
820 | } | 836 | } |
821 | default: | 837 | default: |
822 | return ipmi_ioctl(filep->f_path.dentry->d_inode, filep, cmd, arg); | 838 | return ipmi_ioctl(filep, cmd, arg); |
823 | } | 839 | } |
824 | } | 840 | } |
825 | #endif | 841 | #endif |
826 | 842 | ||
827 | static const struct file_operations ipmi_fops = { | 843 | static const struct file_operations ipmi_fops = { |
828 | .owner = THIS_MODULE, | 844 | .owner = THIS_MODULE, |
829 | .ioctl = ipmi_ioctl, | 845 | .unlocked_ioctl = ipmi_unlocked_ioctl, |
830 | #ifdef CONFIG_COMPAT | 846 | #ifdef CONFIG_COMPAT |
831 | .compat_ioctl = compat_ipmi_ioctl, | 847 | .compat_ioctl = compat_ipmi_ioctl, |
832 | #endif | 848 | #endif |
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index a4d57e31f713..82bcdb262a3a 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c | |||
@@ -659,7 +659,7 @@ static struct watchdog_info ident = { | |||
659 | .identity = "IPMI" | 659 | .identity = "IPMI" |
660 | }; | 660 | }; |
661 | 661 | ||
662 | static int ipmi_ioctl(struct inode *inode, struct file *file, | 662 | static int ipmi_ioctl(struct file *file, |
663 | unsigned int cmd, unsigned long arg) | 663 | unsigned int cmd, unsigned long arg) |
664 | { | 664 | { |
665 | void __user *argp = (void __user *)arg; | 665 | void __user *argp = (void __user *)arg; |
@@ -730,6 +730,19 @@ static int ipmi_ioctl(struct inode *inode, struct file *file, | |||
730 | } | 730 | } |
731 | } | 731 | } |
732 | 732 | ||
733 | static long ipmi_unlocked_ioctl(struct file *file, | ||
734 | unsigned int cmd, | ||
735 | unsigned long arg) | ||
736 | { | ||
737 | int ret; | ||
738 | |||
739 | lock_kernel(); | ||
740 | ret = ipmi_ioctl(file, cmd, arg); | ||
741 | unlock_kernel(); | ||
742 | |||
743 | return ret; | ||
744 | } | ||
745 | |||
733 | static ssize_t ipmi_write(struct file *file, | 746 | static ssize_t ipmi_write(struct file *file, |
734 | const char __user *buf, | 747 | const char __user *buf, |
735 | size_t len, | 748 | size_t len, |
@@ -880,7 +893,7 @@ static const struct file_operations ipmi_wdog_fops = { | |||
880 | .read = ipmi_read, | 893 | .read = ipmi_read, |
881 | .poll = ipmi_poll, | 894 | .poll = ipmi_poll, |
882 | .write = ipmi_write, | 895 | .write = ipmi_write, |
883 | .ioctl = ipmi_ioctl, | 896 | .unlocked_ioctl = ipmi_unlocked_ioctl, |
884 | .open = ipmi_open, | 897 | .open = ipmi_open, |
885 | .release = ipmi_close, | 898 | .release = ipmi_close, |
886 | .fasync = ipmi_fasync, | 899 | .fasync = ipmi_fasync, |
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c index 47e8f7b0e4c1..66d2917b003f 100644 --- a/drivers/char/nvram.c +++ b/drivers/char/nvram.c | |||
@@ -296,8 +296,8 @@ checksum_err: | |||
296 | return -EIO; | 296 | return -EIO; |
297 | } | 297 | } |
298 | 298 | ||
299 | static int nvram_ioctl(struct inode *inode, struct file *file, | 299 | static long nvram_ioctl(struct file *file, unsigned int cmd, |
300 | unsigned int cmd, unsigned long arg) | 300 | unsigned long arg) |
301 | { | 301 | { |
302 | int i; | 302 | int i; |
303 | 303 | ||
@@ -308,6 +308,7 @@ static int nvram_ioctl(struct inode *inode, struct file *file, | |||
308 | if (!capable(CAP_SYS_ADMIN)) | 308 | if (!capable(CAP_SYS_ADMIN)) |
309 | return -EACCES; | 309 | return -EACCES; |
310 | 310 | ||
311 | lock_kernel(); | ||
311 | spin_lock_irq(&rtc_lock); | 312 | spin_lock_irq(&rtc_lock); |
312 | 313 | ||
313 | for (i = 0; i < NVRAM_BYTES; ++i) | 314 | for (i = 0; i < NVRAM_BYTES; ++i) |
@@ -315,6 +316,7 @@ static int nvram_ioctl(struct inode *inode, struct file *file, | |||
315 | __nvram_set_checksum(); | 316 | __nvram_set_checksum(); |
316 | 317 | ||
317 | spin_unlock_irq(&rtc_lock); | 318 | spin_unlock_irq(&rtc_lock); |
319 | unlock_kernel(); | ||
318 | return 0; | 320 | return 0; |
319 | 321 | ||
320 | case NVRAM_SETCKS: | 322 | case NVRAM_SETCKS: |
@@ -323,9 +325,11 @@ static int nvram_ioctl(struct inode *inode, struct file *file, | |||
323 | if (!capable(CAP_SYS_ADMIN)) | 325 | if (!capable(CAP_SYS_ADMIN)) |
324 | return -EACCES; | 326 | return -EACCES; |
325 | 327 | ||
328 | lock_kernel(); | ||
326 | spin_lock_irq(&rtc_lock); | 329 | spin_lock_irq(&rtc_lock); |
327 | __nvram_set_checksum(); | 330 | __nvram_set_checksum(); |
328 | spin_unlock_irq(&rtc_lock); | 331 | spin_unlock_irq(&rtc_lock); |
332 | unlock_kernel(); | ||
329 | return 0; | 333 | return 0; |
330 | 334 | ||
331 | default: | 335 | default: |
@@ -422,7 +426,7 @@ static const struct file_operations nvram_fops = { | |||
422 | .llseek = nvram_llseek, | 426 | .llseek = nvram_llseek, |
423 | .read = nvram_read, | 427 | .read = nvram_read, |
424 | .write = nvram_write, | 428 | .write = nvram_write, |
425 | .ioctl = nvram_ioctl, | 429 | .unlocked_ioctl = nvram_ioctl, |
426 | .open = nvram_open, | 430 | .open = nvram_open, |
427 | .release = nvram_release, | 431 | .release = nvram_release, |
428 | }; | 432 | }; |
diff --git a/drivers/char/nwflash.c b/drivers/char/nwflash.c index f80810901db6..043a1c7b86be 100644 --- a/drivers/char/nwflash.c +++ b/drivers/char/nwflash.c | |||
@@ -94,8 +94,9 @@ static int get_flash_id(void) | |||
94 | return c2; | 94 | return c2; |
95 | } | 95 | } |
96 | 96 | ||
97 | static int flash_ioctl(struct inode *inodep, struct file *filep, unsigned int cmd, unsigned long arg) | 97 | static long flash_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) |
98 | { | 98 | { |
99 | lock_kernel(); | ||
99 | switch (cmd) { | 100 | switch (cmd) { |
100 | case CMD_WRITE_DISABLE: | 101 | case CMD_WRITE_DISABLE: |
101 | gbWriteBase64Enable = 0; | 102 | gbWriteBase64Enable = 0; |
@@ -113,8 +114,10 @@ static int flash_ioctl(struct inode *inodep, struct file *filep, unsigned int cm | |||
113 | default: | 114 | default: |
114 | gbWriteBase64Enable = 0; | 115 | gbWriteBase64Enable = 0; |
115 | gbWriteEnable = 0; | 116 | gbWriteEnable = 0; |
117 | unlock_kernel(); | ||
116 | return -EINVAL; | 118 | return -EINVAL; |
117 | } | 119 | } |
120 | unlock_kernel(); | ||
118 | return 0; | 121 | return 0; |
119 | } | 122 | } |
120 | 123 | ||
@@ -631,7 +634,7 @@ static const struct file_operations flash_fops = | |||
631 | .llseek = flash_llseek, | 634 | .llseek = flash_llseek, |
632 | .read = flash_read, | 635 | .read = flash_read, |
633 | .write = flash_write, | 636 | .write = flash_write, |
634 | .ioctl = flash_ioctl, | 637 | .unlocked_ioctl = flash_ioctl, |
635 | }; | 638 | }; |
636 | 639 | ||
637 | static struct miscdevice flash_miscdev = | 640 | static struct miscdevice flash_miscdev = |
diff --git a/drivers/char/raw.c b/drivers/char/raw.c index 8756ab0daa8b..b38942f6bf31 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c | |||
@@ -121,13 +121,17 @@ static int raw_release(struct inode *inode, struct file *filp) | |||
121 | /* | 121 | /* |
122 | * Forward ioctls to the underlying block device. | 122 | * Forward ioctls to the underlying block device. |
123 | */ | 123 | */ |
124 | static int | 124 | static long |
125 | raw_ioctl(struct inode *inode, struct file *filp, | 125 | raw_ioctl(struct file *filp, unsigned int command, unsigned long arg) |
126 | unsigned int command, unsigned long arg) | ||
127 | { | 126 | { |
128 | struct block_device *bdev = filp->private_data; | 127 | struct block_device *bdev = filp->private_data; |
128 | int ret; | ||
129 | |||
130 | lock_kernel(); | ||
131 | ret = blkdev_ioctl(bdev, 0, command, arg); | ||
132 | unlock_kernel(); | ||
129 | 133 | ||
130 | return blkdev_ioctl(bdev, 0, command, arg); | 134 | return ret; |
131 | } | 135 | } |
132 | 136 | ||
133 | static void bind_device(struct raw_config_request *rq) | 137 | static void bind_device(struct raw_config_request *rq) |
@@ -141,13 +145,14 @@ static void bind_device(struct raw_config_request *rq) | |||
141 | * Deal with ioctls against the raw-device control interface, to bind | 145 | * Deal with ioctls against the raw-device control interface, to bind |
142 | * and unbind other raw devices. | 146 | * and unbind other raw devices. |
143 | */ | 147 | */ |
144 | static int raw_ctl_ioctl(struct inode *inode, struct file *filp, | 148 | static long raw_ctl_ioctl(struct file *filp, unsigned int command, |
145 | unsigned int command, unsigned long arg) | 149 | unsigned long arg) |
146 | { | 150 | { |
147 | struct raw_config_request rq; | 151 | struct raw_config_request rq; |
148 | struct raw_device_data *rawdev; | 152 | struct raw_device_data *rawdev; |
149 | int err = 0; | 153 | int err = 0; |
150 | 154 | ||
155 | lock_kernel(); | ||
151 | switch (command) { | 156 | switch (command) { |
152 | case RAW_SETBIND: | 157 | case RAW_SETBIND: |
153 | case RAW_GETBIND: | 158 | case RAW_GETBIND: |
@@ -240,25 +245,26 @@ static int raw_ctl_ioctl(struct inode *inode, struct file *filp, | |||
240 | break; | 245 | break; |
241 | } | 246 | } |
242 | out: | 247 | out: |
248 | unlock_kernel(); | ||
243 | return err; | 249 | return err; |
244 | } | 250 | } |
245 | 251 | ||
246 | static const struct file_operations raw_fops = { | 252 | static const struct file_operations raw_fops = { |
247 | .read = do_sync_read, | 253 | .read = do_sync_read, |
248 | .aio_read = generic_file_aio_read, | 254 | .aio_read = generic_file_aio_read, |
249 | .write = do_sync_write, | 255 | .write = do_sync_write, |
250 | .aio_write = blkdev_aio_write, | 256 | .aio_write = blkdev_aio_write, |
251 | .fsync = blkdev_fsync, | 257 | .fsync = blkdev_fsync, |
252 | .open = raw_open, | 258 | .open = raw_open, |
253 | .release= raw_release, | 259 | .release = raw_release, |
254 | .ioctl = raw_ioctl, | 260 | .unlocked_ioctl = raw_ioctl, |
255 | .owner = THIS_MODULE, | 261 | .owner = THIS_MODULE, |
256 | }; | 262 | }; |
257 | 263 | ||
258 | static const struct file_operations raw_ctl_fops = { | 264 | static const struct file_operations raw_ctl_fops = { |
259 | .ioctl = raw_ctl_ioctl, | 265 | .unlocked_ioctl = raw_ctl_ioctl, |
260 | .open = raw_open, | 266 | .open = raw_open, |
261 | .owner = THIS_MODULE, | 267 | .owner = THIS_MODULE, |
262 | }; | 268 | }; |
263 | 269 | ||
264 | static struct cdev raw_cdev; | 270 | static struct cdev raw_cdev; |
diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c index 0627f7a5b9b8..b7ca2a9676cf 100644 --- a/drivers/hwmon/fschmd.c +++ b/drivers/hwmon/fschmd.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/i2c.h> | 38 | #include <linux/i2c.h> |
39 | #include <linux/hwmon.h> | 39 | #include <linux/hwmon.h> |
40 | #include <linux/hwmon-sysfs.h> | 40 | #include <linux/hwmon-sysfs.h> |
41 | #include <linux/smp_lock.h> | ||
41 | #include <linux/err.h> | 42 | #include <linux/err.h> |
42 | #include <linux/mutex.h> | 43 | #include <linux/mutex.h> |
43 | #include <linux/sysfs.h> | 44 | #include <linux/sysfs.h> |
@@ -847,8 +848,7 @@ static ssize_t watchdog_write(struct file *filp, const char __user *buf, | |||
847 | return count; | 848 | return count; |
848 | } | 849 | } |
849 | 850 | ||
850 | static int watchdog_ioctl(struct inode *inode, struct file *filp, | 851 | static long watchdog_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
851 | unsigned int cmd, unsigned long arg) | ||
852 | { | 852 | { |
853 | static struct watchdog_info ident = { | 853 | static struct watchdog_info ident = { |
854 | .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | | 854 | .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | |
@@ -858,6 +858,7 @@ static int watchdog_ioctl(struct inode *inode, struct file *filp, | |||
858 | int i, ret = 0; | 858 | int i, ret = 0; |
859 | struct fschmd_data *data = filp->private_data; | 859 | struct fschmd_data *data = filp->private_data; |
860 | 860 | ||
861 | lock_kernel(); | ||
861 | switch (cmd) { | 862 | switch (cmd) { |
862 | case WDIOC_GETSUPPORT: | 863 | case WDIOC_GETSUPPORT: |
863 | ident.firmware_version = data->revision; | 864 | ident.firmware_version = data->revision; |
@@ -914,7 +915,7 @@ static int watchdog_ioctl(struct inode *inode, struct file *filp, | |||
914 | default: | 915 | default: |
915 | ret = -ENOTTY; | 916 | ret = -ENOTTY; |
916 | } | 917 | } |
917 | 918 | unlock_kernel(); | |
918 | return ret; | 919 | return ret; |
919 | } | 920 | } |
920 | 921 | ||
@@ -924,7 +925,7 @@ static const struct file_operations watchdog_fops = { | |||
924 | .open = watchdog_open, | 925 | .open = watchdog_open, |
925 | .release = watchdog_release, | 926 | .release = watchdog_release, |
926 | .write = watchdog_write, | 927 | .write = watchdog_write, |
927 | .ioctl = watchdog_ioctl, | 928 | .unlocked_ioctl = watchdog_ioctl, |
928 | }; | 929 | }; |
929 | 930 | ||
930 | 931 | ||
diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c index 612807d97155..697202e27891 100644 --- a/drivers/hwmon/w83793.c +++ b/drivers/hwmon/w83793.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/slab.h> | 35 | #include <linux/slab.h> |
36 | #include <linux/i2c.h> | 36 | #include <linux/i2c.h> |
37 | #include <linux/hwmon.h> | 37 | #include <linux/hwmon.h> |
38 | #include <linux/smp_lock.h> | ||
38 | #include <linux/hwmon-vid.h> | 39 | #include <linux/hwmon-vid.h> |
39 | #include <linux/hwmon-sysfs.h> | 40 | #include <linux/hwmon-sysfs.h> |
40 | #include <linux/err.h> | 41 | #include <linux/err.h> |
@@ -1319,8 +1320,8 @@ static ssize_t watchdog_write(struct file *filp, const char __user *buf, | |||
1319 | return count; | 1320 | return count; |
1320 | } | 1321 | } |
1321 | 1322 | ||
1322 | static int watchdog_ioctl(struct inode *inode, struct file *filp, | 1323 | static long watchdog_ioctl(struct file *filp, unsigned int cmd, |
1323 | unsigned int cmd, unsigned long arg) | 1324 | unsigned long arg) |
1324 | { | 1325 | { |
1325 | static struct watchdog_info ident = { | 1326 | static struct watchdog_info ident = { |
1326 | .options = WDIOF_KEEPALIVEPING | | 1327 | .options = WDIOF_KEEPALIVEPING | |
@@ -1332,6 +1333,7 @@ static int watchdog_ioctl(struct inode *inode, struct file *filp, | |||
1332 | int val, ret = 0; | 1333 | int val, ret = 0; |
1333 | struct w83793_data *data = filp->private_data; | 1334 | struct w83793_data *data = filp->private_data; |
1334 | 1335 | ||
1336 | lock_kernel(); | ||
1335 | switch (cmd) { | 1337 | switch (cmd) { |
1336 | case WDIOC_GETSUPPORT: | 1338 | case WDIOC_GETSUPPORT: |
1337 | if (!nowayout) | 1339 | if (!nowayout) |
@@ -1385,7 +1387,7 @@ static int watchdog_ioctl(struct inode *inode, struct file *filp, | |||
1385 | default: | 1387 | default: |
1386 | ret = -ENOTTY; | 1388 | ret = -ENOTTY; |
1387 | } | 1389 | } |
1388 | 1390 | unlock_kernel(); | |
1389 | return ret; | 1391 | return ret; |
1390 | } | 1392 | } |
1391 | 1393 | ||
@@ -1395,7 +1397,7 @@ static const struct file_operations watchdog_fops = { | |||
1395 | .open = watchdog_open, | 1397 | .open = watchdog_open, |
1396 | .release = watchdog_close, | 1398 | .release = watchdog_close, |
1397 | .write = watchdog_write, | 1399 | .write = watchdog_write, |
1398 | .ioctl = watchdog_ioctl, | 1400 | .unlocked_ioctl = watchdog_ioctl, |
1399 | }; | 1401 | }; |
1400 | 1402 | ||
1401 | /* | 1403 | /* |
diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c index ad730e15afc0..e00a1cc79c0a 100644 --- a/drivers/input/misc/hp_sdc_rtc.c +++ b/drivers/input/misc/hp_sdc_rtc.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <linux/proc_fs.h> | 43 | #include <linux/proc_fs.h> |
44 | #include <linux/poll.h> | 44 | #include <linux/poll.h> |
45 | #include <linux/rtc.h> | 45 | #include <linux/rtc.h> |
46 | #include <linux/smp_lock.h> | ||
46 | #include <linux/semaphore.h> | 47 | #include <linux/semaphore.h> |
47 | 48 | ||
48 | MODULE_AUTHOR("Brian S. Julin <bri@calyx.com>"); | 49 | MODULE_AUTHOR("Brian S. Julin <bri@calyx.com>"); |
@@ -64,8 +65,8 @@ static DECLARE_WAIT_QUEUE_HEAD(hp_sdc_rtc_wait); | |||
64 | static ssize_t hp_sdc_rtc_read(struct file *file, char __user *buf, | 65 | static ssize_t hp_sdc_rtc_read(struct file *file, char __user *buf, |
65 | size_t count, loff_t *ppos); | 66 | size_t count, loff_t *ppos); |
66 | 67 | ||
67 | static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file, | 68 | static long hp_sdc_rtc_unlocked_ioctl(struct file *file, |
68 | unsigned int cmd, unsigned long arg); | 69 | unsigned int cmd, unsigned long arg); |
69 | 70 | ||
70 | static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait); | 71 | static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait); |
71 | 72 | ||
@@ -512,7 +513,7 @@ static int hp_sdc_rtc_read_proc(char *page, char **start, off_t off, | |||
512 | return len; | 513 | return len; |
513 | } | 514 | } |
514 | 515 | ||
515 | static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file, | 516 | static int hp_sdc_rtc_ioctl(struct file *file, |
516 | unsigned int cmd, unsigned long arg) | 517 | unsigned int cmd, unsigned long arg) |
517 | { | 518 | { |
518 | #if 1 | 519 | #if 1 |
@@ -659,14 +660,27 @@ static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file, | |||
659 | #endif | 660 | #endif |
660 | } | 661 | } |
661 | 662 | ||
663 | static long hp_sdc_rtc_unlocked_ioctl(struct file *file, | ||
664 | unsigned int cmd, unsigned long arg) | ||
665 | { | ||
666 | int ret; | ||
667 | |||
668 | lock_kernel(); | ||
669 | ret = hp_sdc_rtc_ioctl(file, cmd, arg); | ||
670 | unlock_kernel(); | ||
671 | |||
672 | return ret; | ||
673 | } | ||
674 | |||
675 | |||
662 | static const struct file_operations hp_sdc_rtc_fops = { | 676 | static const struct file_operations hp_sdc_rtc_fops = { |
663 | .owner = THIS_MODULE, | 677 | .owner = THIS_MODULE, |
664 | .llseek = no_llseek, | 678 | .llseek = no_llseek, |
665 | .read = hp_sdc_rtc_read, | 679 | .read = hp_sdc_rtc_read, |
666 | .poll = hp_sdc_rtc_poll, | 680 | .poll = hp_sdc_rtc_poll, |
667 | .ioctl = hp_sdc_rtc_ioctl, | 681 | .unlocked_ioctl = hp_sdc_rtc_ioctl, |
668 | .open = hp_sdc_rtc_open, | 682 | .open = hp_sdc_rtc_open, |
669 | .fasync = hp_sdc_rtc_fasync, | 683 | .fasync = hp_sdc_rtc_fasync, |
670 | }; | 684 | }; |
671 | 685 | ||
672 | static struct miscdevice hp_sdc_rtc_dev = { | 686 | static struct miscdevice hp_sdc_rtc_dev = { |
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index ee5837522f5a..0cabe31f26df 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c | |||
@@ -787,8 +787,7 @@ capi_poll(struct file *file, poll_table * wait) | |||
787 | } | 787 | } |
788 | 788 | ||
789 | static int | 789 | static int |
790 | capi_ioctl(struct inode *inode, struct file *file, | 790 | capi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
791 | unsigned int cmd, unsigned long arg) | ||
792 | { | 791 | { |
793 | struct capidev *cdev = file->private_data; | 792 | struct capidev *cdev = file->private_data; |
794 | capi_ioctl_struct data; | 793 | capi_ioctl_struct data; |
@@ -981,6 +980,18 @@ register_out: | |||
981 | } | 980 | } |
982 | } | 981 | } |
983 | 982 | ||
983 | static long | ||
984 | capi_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
985 | { | ||
986 | int ret; | ||
987 | |||
988 | lock_kernel(); | ||
989 | ret = capi_ioctl(file, cmd, arg); | ||
990 | unlock_kernel(); | ||
991 | |||
992 | return ret; | ||
993 | } | ||
994 | |||
984 | static int capi_open(struct inode *inode, struct file *file) | 995 | static int capi_open(struct inode *inode, struct file *file) |
985 | { | 996 | { |
986 | struct capidev *cdev; | 997 | struct capidev *cdev; |
@@ -1026,7 +1037,7 @@ static const struct file_operations capi_fops = | |||
1026 | .read = capi_read, | 1037 | .read = capi_read, |
1027 | .write = capi_write, | 1038 | .write = capi_write, |
1028 | .poll = capi_poll, | 1039 | .poll = capi_poll, |
1029 | .ioctl = capi_ioctl, | 1040 | .unlocked_ioctl = capi_unlocked_ioctl, |
1030 | .open = capi_open, | 1041 | .open = capi_open, |
1031 | .release = capi_release, | 1042 | .release = capi_release, |
1032 | }; | 1043 | }; |
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index 70044ee4b228..a44cdb492ea9 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c | |||
@@ -1272,9 +1272,9 @@ isdn_poll(struct file *file, poll_table * wait) | |||
1272 | 1272 | ||
1273 | 1273 | ||
1274 | static int | 1274 | static int |
1275 | isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg) | 1275 | isdn_ioctl(struct file *file, uint cmd, ulong arg) |
1276 | { | 1276 | { |
1277 | uint minor = iminor(inode); | 1277 | uint minor = iminor(file->f_path.dentry->d_inode); |
1278 | isdn_ctrl c; | 1278 | isdn_ctrl c; |
1279 | int drvidx; | 1279 | int drvidx; |
1280 | int chidx; | 1280 | int chidx; |
@@ -1722,6 +1722,18 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg) | |||
1722 | #undef cfg | 1722 | #undef cfg |
1723 | } | 1723 | } |
1724 | 1724 | ||
1725 | static long | ||
1726 | isdn_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
1727 | { | ||
1728 | int ret; | ||
1729 | |||
1730 | lock_kernel(); | ||
1731 | ret = isdn_ioctl(file, cmd, arg); | ||
1732 | unlock_kernel(); | ||
1733 | |||
1734 | return ret; | ||
1735 | } | ||
1736 | |||
1725 | /* | 1737 | /* |
1726 | * Open the device code. | 1738 | * Open the device code. |
1727 | */ | 1739 | */ |
@@ -1838,7 +1850,7 @@ static const struct file_operations isdn_fops = | |||
1838 | .read = isdn_read, | 1850 | .read = isdn_read, |
1839 | .write = isdn_write, | 1851 | .write = isdn_write, |
1840 | .poll = isdn_poll, | 1852 | .poll = isdn_poll, |
1841 | .ioctl = isdn_ioctl, | 1853 | .unlocked_ioctl = isdn_unlocked_ioctl, |
1842 | .open = isdn_open, | 1854 | .open = isdn_open, |
1843 | .release = isdn_close, | 1855 | .release = isdn_close, |
1844 | }; | 1856 | }; |
diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c index 8785004e85e0..c3243c913ec0 100644 --- a/drivers/isdn/mISDN/timerdev.c +++ b/drivers/isdn/mISDN/timerdev.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/miscdevice.h> | 24 | #include <linux/miscdevice.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/mISDNif.h> | 26 | #include <linux/mISDNif.h> |
27 | #include <linux/smp_lock.h> | ||
27 | #include "core.h" | 28 | #include "core.h" |
28 | 29 | ||
29 | static u_int *debug; | 30 | static u_int *debug; |
@@ -215,9 +216,8 @@ unlock: | |||
215 | return ret; | 216 | return ret; |
216 | } | 217 | } |
217 | 218 | ||
218 | static int | 219 | static long |
219 | mISDN_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, | 220 | mISDN_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) |
220 | unsigned long arg) | ||
221 | { | 221 | { |
222 | struct mISDNtimerdev *dev = filep->private_data; | 222 | struct mISDNtimerdev *dev = filep->private_data; |
223 | int id, tout, ret = 0; | 223 | int id, tout, ret = 0; |
@@ -226,6 +226,7 @@ mISDN_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, | |||
226 | if (*debug & DEBUG_TIMER) | 226 | if (*debug & DEBUG_TIMER) |
227 | printk(KERN_DEBUG "%s(%p, %x, %lx)\n", __func__, | 227 | printk(KERN_DEBUG "%s(%p, %x, %lx)\n", __func__, |
228 | filep, cmd, arg); | 228 | filep, cmd, arg); |
229 | lock_kernel(); | ||
229 | switch (cmd) { | 230 | switch (cmd) { |
230 | case IMADDTIMER: | 231 | case IMADDTIMER: |
231 | if (get_user(tout, (int __user *)arg)) { | 232 | if (get_user(tout, (int __user *)arg)) { |
@@ -257,13 +258,14 @@ mISDN_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, | |||
257 | default: | 258 | default: |
258 | ret = -EINVAL; | 259 | ret = -EINVAL; |
259 | } | 260 | } |
261 | unlock_kernel(); | ||
260 | return ret; | 262 | return ret; |
261 | } | 263 | } |
262 | 264 | ||
263 | static const struct file_operations mISDN_fops = { | 265 | static const struct file_operations mISDN_fops = { |
264 | .read = mISDN_read, | 266 | .read = mISDN_read, |
265 | .poll = mISDN_poll, | 267 | .poll = mISDN_poll, |
266 | .ioctl = mISDN_ioctl, | 268 | .unlocked_ioctl = mISDN_ioctl, |
267 | .open = mISDN_open, | 269 | .open = mISDN_open, |
268 | .release = mISDN_close, | 270 | .release = mISDN_close, |
269 | }; | 271 | }; |
diff --git a/drivers/macintosh/nvram.c b/drivers/macintosh/nvram.c index c876349c32de..a271c8218d82 100644 --- a/drivers/macintosh/nvram.c +++ b/drivers/macintosh/nvram.c | |||
@@ -100,7 +100,7 @@ const struct file_operations nvram_fops = { | |||
100 | .llseek = nvram_llseek, | 100 | .llseek = nvram_llseek, |
101 | .read = read_nvram, | 101 | .read = read_nvram, |
102 | .write = write_nvram, | 102 | .write = write_nvram, |
103 | .ioctl = nvram_ioctl, | 103 | .unlocked_ioctl = nvram_ioctl, |
104 | }; | 104 | }; |
105 | 105 | ||
106 | static struct miscdevice nvram_dev = { | 106 | static struct miscdevice nvram_dev = { |
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index 42764849eb78..3d4fc0f7b00b 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c | |||
@@ -2273,8 +2273,7 @@ static int register_pmu_pm_ops(void) | |||
2273 | device_initcall(register_pmu_pm_ops); | 2273 | device_initcall(register_pmu_pm_ops); |
2274 | #endif | 2274 | #endif |
2275 | 2275 | ||
2276 | static int | 2276 | static int pmu_ioctl(struct file *filp, |
2277 | pmu_ioctl(struct inode * inode, struct file *filp, | ||
2278 | u_int cmd, u_long arg) | 2277 | u_int cmd, u_long arg) |
2279 | { | 2278 | { |
2280 | __u32 __user *argp = (__u32 __user *)arg; | 2279 | __u32 __user *argp = (__u32 __user *)arg; |
@@ -2337,11 +2336,23 @@ pmu_ioctl(struct inode * inode, struct file *filp, | |||
2337 | return error; | 2336 | return error; |
2338 | } | 2337 | } |
2339 | 2338 | ||
2339 | static long pmu_unlocked_ioctl(struct file *filp, | ||
2340 | u_int cmd, u_long arg) | ||
2341 | { | ||
2342 | int ret; | ||
2343 | |||
2344 | lock_kernel(); | ||
2345 | ret = pmu_ioctl(filp, cmd, arg); | ||
2346 | unlock_kernel(); | ||
2347 | |||
2348 | return ret; | ||
2349 | } | ||
2350 | |||
2340 | static const struct file_operations pmu_device_fops = { | 2351 | static const struct file_operations pmu_device_fops = { |
2341 | .read = pmu_read, | 2352 | .read = pmu_read, |
2342 | .write = pmu_write, | 2353 | .write = pmu_write, |
2343 | .poll = pmu_fpoll, | 2354 | .poll = pmu_fpoll, |
2344 | .ioctl = pmu_ioctl, | 2355 | .unlocked_ioctl = pmu_unlocked_ioctl, |
2345 | .open = pmu_open, | 2356 | .open = pmu_open, |
2346 | .release = pmu_release, | 2357 | .release = pmu_release, |
2347 | }; | 2358 | }; |
diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c index 9ddc57909d49..425862ffb285 100644 --- a/drivers/media/dvb/dvb-core/dmxdev.c +++ b/drivers/media/dvb/dvb-core/dmxdev.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/vmalloc.h> | 26 | #include <linux/vmalloc.h> |
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
28 | #include <linux/smp_lock.h> | ||
28 | #include <linux/poll.h> | 29 | #include <linux/poll.h> |
29 | #include <linux/ioctl.h> | 30 | #include <linux/ioctl.h> |
30 | #include <linux/wait.h> | 31 | #include <linux/wait.h> |
@@ -963,7 +964,7 @@ dvb_demux_read(struct file *file, char __user *buf, size_t count, | |||
963 | return ret; | 964 | return ret; |
964 | } | 965 | } |
965 | 966 | ||
966 | static int dvb_demux_do_ioctl(struct inode *inode, struct file *file, | 967 | static int dvb_demux_do_ioctl(struct file *file, |
967 | unsigned int cmd, void *parg) | 968 | unsigned int cmd, void *parg) |
968 | { | 969 | { |
969 | struct dmxdev_filter *dmxdevfilter = file->private_data; | 970 | struct dmxdev_filter *dmxdevfilter = file->private_data; |
@@ -1084,10 +1085,16 @@ static int dvb_demux_do_ioctl(struct inode *inode, struct file *file, | |||
1084 | return ret; | 1085 | return ret; |
1085 | } | 1086 | } |
1086 | 1087 | ||
1087 | static int dvb_demux_ioctl(struct inode *inode, struct file *file, | 1088 | static long dvb_demux_ioctl(struct file *file, unsigned int cmd, |
1088 | unsigned int cmd, unsigned long arg) | 1089 | unsigned long arg) |
1089 | { | 1090 | { |
1090 | return dvb_usercopy(inode, file, cmd, arg, dvb_demux_do_ioctl); | 1091 | int ret; |
1092 | |||
1093 | lock_kernel(); | ||
1094 | ret = dvb_usercopy(file, cmd, arg, dvb_demux_do_ioctl); | ||
1095 | unlock_kernel(); | ||
1096 | |||
1097 | return ret; | ||
1091 | } | 1098 | } |
1092 | 1099 | ||
1093 | static unsigned int dvb_demux_poll(struct file *file, poll_table *wait) | 1100 | static unsigned int dvb_demux_poll(struct file *file, poll_table *wait) |
@@ -1139,7 +1146,7 @@ static int dvb_demux_release(struct inode *inode, struct file *file) | |||
1139 | static const struct file_operations dvb_demux_fops = { | 1146 | static const struct file_operations dvb_demux_fops = { |
1140 | .owner = THIS_MODULE, | 1147 | .owner = THIS_MODULE, |
1141 | .read = dvb_demux_read, | 1148 | .read = dvb_demux_read, |
1142 | .ioctl = dvb_demux_ioctl, | 1149 | .unlocked_ioctl = dvb_demux_ioctl, |
1143 | .open = dvb_demux_open, | 1150 | .open = dvb_demux_open, |
1144 | .release = dvb_demux_release, | 1151 | .release = dvb_demux_release, |
1145 | .poll = dvb_demux_poll, | 1152 | .poll = dvb_demux_poll, |
@@ -1152,7 +1159,7 @@ static struct dvb_device dvbdev_demux = { | |||
1152 | .fops = &dvb_demux_fops | 1159 | .fops = &dvb_demux_fops |
1153 | }; | 1160 | }; |
1154 | 1161 | ||
1155 | static int dvb_dvr_do_ioctl(struct inode *inode, struct file *file, | 1162 | static int dvb_dvr_do_ioctl(struct file *file, |
1156 | unsigned int cmd, void *parg) | 1163 | unsigned int cmd, void *parg) |
1157 | { | 1164 | { |
1158 | struct dvb_device *dvbdev = file->private_data; | 1165 | struct dvb_device *dvbdev = file->private_data; |
@@ -1176,10 +1183,16 @@ static int dvb_dvr_do_ioctl(struct inode *inode, struct file *file, | |||
1176 | return ret; | 1183 | return ret; |
1177 | } | 1184 | } |
1178 | 1185 | ||
1179 | static int dvb_dvr_ioctl(struct inode *inode, struct file *file, | 1186 | static long dvb_dvr_ioctl(struct file *file, |
1180 | unsigned int cmd, unsigned long arg) | 1187 | unsigned int cmd, unsigned long arg) |
1181 | { | 1188 | { |
1182 | return dvb_usercopy(inode, file, cmd, arg, dvb_dvr_do_ioctl); | 1189 | int ret; |
1190 | |||
1191 | lock_kernel(); | ||
1192 | ret = dvb_usercopy(file, cmd, arg, dvb_dvr_do_ioctl); | ||
1193 | unlock_kernel(); | ||
1194 | |||
1195 | return ret; | ||
1183 | } | 1196 | } |
1184 | 1197 | ||
1185 | static unsigned int dvb_dvr_poll(struct file *file, poll_table *wait) | 1198 | static unsigned int dvb_dvr_poll(struct file *file, poll_table *wait) |
@@ -1208,7 +1221,7 @@ static const struct file_operations dvb_dvr_fops = { | |||
1208 | .owner = THIS_MODULE, | 1221 | .owner = THIS_MODULE, |
1209 | .read = dvb_dvr_read, | 1222 | .read = dvb_dvr_read, |
1210 | .write = dvb_dvr_write, | 1223 | .write = dvb_dvr_write, |
1211 | .ioctl = dvb_dvr_ioctl, | 1224 | .unlocked_ioctl = dvb_dvr_ioctl, |
1212 | .open = dvb_dvr_open, | 1225 | .open = dvb_dvr_open, |
1213 | .release = dvb_dvr_release, | 1226 | .release = dvb_dvr_release, |
1214 | .poll = dvb_dvr_poll, | 1227 | .poll = dvb_dvr_poll, |
diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c index cb22da53bfb0..ef259a0718ac 100644 --- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/delay.h> | 36 | #include <linux/delay.h> |
37 | #include <linux/spinlock.h> | 37 | #include <linux/spinlock.h> |
38 | #include <linux/sched.h> | 38 | #include <linux/sched.h> |
39 | #include <linux/smp_lock.h> | ||
39 | #include <linux/kthread.h> | 40 | #include <linux/kthread.h> |
40 | 41 | ||
41 | #include "dvb_ca_en50221.h" | 42 | #include "dvb_ca_en50221.h" |
@@ -1181,7 +1182,7 @@ static int dvb_ca_en50221_thread(void *data) | |||
1181 | * | 1182 | * |
1182 | * @return 0 on success, <0 on error. | 1183 | * @return 0 on success, <0 on error. |
1183 | */ | 1184 | */ |
1184 | static int dvb_ca_en50221_io_do_ioctl(struct inode *inode, struct file *file, | 1185 | static int dvb_ca_en50221_io_do_ioctl(struct file *file, |
1185 | unsigned int cmd, void *parg) | 1186 | unsigned int cmd, void *parg) |
1186 | { | 1187 | { |
1187 | struct dvb_device *dvbdev = file->private_data; | 1188 | struct dvb_device *dvbdev = file->private_data; |
@@ -1255,10 +1256,16 @@ static int dvb_ca_en50221_io_do_ioctl(struct inode *inode, struct file *file, | |||
1255 | * | 1256 | * |
1256 | * @return 0 on success, <0 on error. | 1257 | * @return 0 on success, <0 on error. |
1257 | */ | 1258 | */ |
1258 | static int dvb_ca_en50221_io_ioctl(struct inode *inode, struct file *file, | 1259 | static long dvb_ca_en50221_io_ioctl(struct file *file, |
1259 | unsigned int cmd, unsigned long arg) | 1260 | unsigned int cmd, unsigned long arg) |
1260 | { | 1261 | { |
1261 | return dvb_usercopy(inode, file, cmd, arg, dvb_ca_en50221_io_do_ioctl); | 1262 | int ret; |
1263 | |||
1264 | lock_kernel(); | ||
1265 | ret = dvb_usercopy(file, cmd, arg, dvb_ca_en50221_io_do_ioctl); | ||
1266 | unlock_kernel(); | ||
1267 | |||
1268 | return ret; | ||
1262 | } | 1269 | } |
1263 | 1270 | ||
1264 | 1271 | ||
@@ -1611,7 +1618,7 @@ static const struct file_operations dvb_ca_fops = { | |||
1611 | .owner = THIS_MODULE, | 1618 | .owner = THIS_MODULE, |
1612 | .read = dvb_ca_en50221_io_read, | 1619 | .read = dvb_ca_en50221_io_read, |
1613 | .write = dvb_ca_en50221_io_write, | 1620 | .write = dvb_ca_en50221_io_write, |
1614 | .ioctl = dvb_ca_en50221_io_ioctl, | 1621 | .unlocked_ioctl = dvb_ca_en50221_io_ioctl, |
1615 | .open = dvb_ca_en50221_io_open, | 1622 | .open = dvb_ca_en50221_io_open, |
1616 | .release = dvb_ca_en50221_io_release, | 1623 | .release = dvb_ca_en50221_io_release, |
1617 | .poll = dvb_ca_en50221_io_poll, | 1624 | .poll = dvb_ca_en50221_io_poll, |
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 6932def4d266..44ae89ecef94 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/list.h> | 36 | #include <linux/list.h> |
37 | #include <linux/freezer.h> | 37 | #include <linux/freezer.h> |
38 | #include <linux/jiffies.h> | 38 | #include <linux/jiffies.h> |
39 | #include <linux/smp_lock.h> | ||
39 | #include <linux/kthread.h> | 40 | #include <linux/kthread.h> |
40 | #include <asm/processor.h> | 41 | #include <asm/processor.h> |
41 | 42 | ||
@@ -1195,14 +1196,14 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe) | |||
1195 | } | 1196 | } |
1196 | } | 1197 | } |
1197 | 1198 | ||
1198 | static int dvb_frontend_ioctl_legacy(struct inode *inode, struct file *file, | 1199 | static int dvb_frontend_ioctl_legacy(struct file *file, |
1199 | unsigned int cmd, void *parg); | 1200 | unsigned int cmd, void *parg); |
1200 | static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file, | 1201 | static int dvb_frontend_ioctl_properties(struct file *file, |
1201 | unsigned int cmd, void *parg); | 1202 | unsigned int cmd, void *parg); |
1202 | 1203 | ||
1203 | static int dtv_property_process_get(struct dvb_frontend *fe, | 1204 | static int dtv_property_process_get(struct dvb_frontend *fe, |
1204 | struct dtv_property *tvp, | 1205 | struct dtv_property *tvp, |
1205 | struct inode *inode, struct file *file) | 1206 | struct file *file) |
1206 | { | 1207 | { |
1207 | int r = 0; | 1208 | int r = 0; |
1208 | 1209 | ||
@@ -1335,7 +1336,6 @@ static int dtv_property_process_get(struct dvb_frontend *fe, | |||
1335 | 1336 | ||
1336 | static int dtv_property_process_set(struct dvb_frontend *fe, | 1337 | static int dtv_property_process_set(struct dvb_frontend *fe, |
1337 | struct dtv_property *tvp, | 1338 | struct dtv_property *tvp, |
1338 | struct inode *inode, | ||
1339 | struct file *file) | 1339 | struct file *file) |
1340 | { | 1340 | { |
1341 | int r = 0; | 1341 | int r = 0; |
@@ -1366,7 +1366,7 @@ static int dtv_property_process_set(struct dvb_frontend *fe, | |||
1366 | dprintk("%s() Finalised property cache\n", __func__); | 1366 | dprintk("%s() Finalised property cache\n", __func__); |
1367 | dtv_property_cache_submit(fe); | 1367 | dtv_property_cache_submit(fe); |
1368 | 1368 | ||
1369 | r |= dvb_frontend_ioctl_legacy(inode, file, FE_SET_FRONTEND, | 1369 | r |= dvb_frontend_ioctl_legacy(file, FE_SET_FRONTEND, |
1370 | &fepriv->parameters); | 1370 | &fepriv->parameters); |
1371 | break; | 1371 | break; |
1372 | case DTV_FREQUENCY: | 1372 | case DTV_FREQUENCY: |
@@ -1398,12 +1398,12 @@ static int dtv_property_process_set(struct dvb_frontend *fe, | |||
1398 | break; | 1398 | break; |
1399 | case DTV_VOLTAGE: | 1399 | case DTV_VOLTAGE: |
1400 | fe->dtv_property_cache.voltage = tvp->u.data; | 1400 | fe->dtv_property_cache.voltage = tvp->u.data; |
1401 | r = dvb_frontend_ioctl_legacy(inode, file, FE_SET_VOLTAGE, | 1401 | r = dvb_frontend_ioctl_legacy(file, FE_SET_VOLTAGE, |
1402 | (void *)fe->dtv_property_cache.voltage); | 1402 | (void *)fe->dtv_property_cache.voltage); |
1403 | break; | 1403 | break; |
1404 | case DTV_TONE: | 1404 | case DTV_TONE: |
1405 | fe->dtv_property_cache.sectone = tvp->u.data; | 1405 | fe->dtv_property_cache.sectone = tvp->u.data; |
1406 | r = dvb_frontend_ioctl_legacy(inode, file, FE_SET_TONE, | 1406 | r = dvb_frontend_ioctl_legacy(file, FE_SET_TONE, |
1407 | (void *)fe->dtv_property_cache.sectone); | 1407 | (void *)fe->dtv_property_cache.sectone); |
1408 | break; | 1408 | break; |
1409 | case DTV_CODE_RATE_HP: | 1409 | case DTV_CODE_RATE_HP: |
@@ -1487,7 +1487,7 @@ static int dtv_property_process_set(struct dvb_frontend *fe, | |||
1487 | return r; | 1487 | return r; |
1488 | } | 1488 | } |
1489 | 1489 | ||
1490 | static int dvb_frontend_ioctl(struct inode *inode, struct file *file, | 1490 | static int dvb_frontend_ioctl(struct file *file, |
1491 | unsigned int cmd, void *parg) | 1491 | unsigned int cmd, void *parg) |
1492 | { | 1492 | { |
1493 | struct dvb_device *dvbdev = file->private_data; | 1493 | struct dvb_device *dvbdev = file->private_data; |
@@ -1509,17 +1509,17 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, | |||
1509 | return -ERESTARTSYS; | 1509 | return -ERESTARTSYS; |
1510 | 1510 | ||
1511 | if ((cmd == FE_SET_PROPERTY) || (cmd == FE_GET_PROPERTY)) | 1511 | if ((cmd == FE_SET_PROPERTY) || (cmd == FE_GET_PROPERTY)) |
1512 | err = dvb_frontend_ioctl_properties(inode, file, cmd, parg); | 1512 | err = dvb_frontend_ioctl_properties(file, cmd, parg); |
1513 | else { | 1513 | else { |
1514 | fe->dtv_property_cache.state = DTV_UNDEFINED; | 1514 | fe->dtv_property_cache.state = DTV_UNDEFINED; |
1515 | err = dvb_frontend_ioctl_legacy(inode, file, cmd, parg); | 1515 | err = dvb_frontend_ioctl_legacy(file, cmd, parg); |
1516 | } | 1516 | } |
1517 | 1517 | ||
1518 | up(&fepriv->sem); | 1518 | up(&fepriv->sem); |
1519 | return err; | 1519 | return err; |
1520 | } | 1520 | } |
1521 | 1521 | ||
1522 | static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file, | 1522 | static int dvb_frontend_ioctl_properties(struct file *file, |
1523 | unsigned int cmd, void *parg) | 1523 | unsigned int cmd, void *parg) |
1524 | { | 1524 | { |
1525 | struct dvb_device *dvbdev = file->private_data; | 1525 | struct dvb_device *dvbdev = file->private_data; |
@@ -1555,7 +1555,7 @@ static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file, | |||
1555 | } | 1555 | } |
1556 | 1556 | ||
1557 | for (i = 0; i < tvps->num; i++) { | 1557 | for (i = 0; i < tvps->num; i++) { |
1558 | (tvp + i)->result = dtv_property_process_set(fe, tvp + i, inode, file); | 1558 | (tvp + i)->result = dtv_property_process_set(fe, tvp + i, file); |
1559 | err |= (tvp + i)->result; | 1559 | err |= (tvp + i)->result; |
1560 | } | 1560 | } |
1561 | 1561 | ||
@@ -1587,7 +1587,7 @@ static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file, | |||
1587 | } | 1587 | } |
1588 | 1588 | ||
1589 | for (i = 0; i < tvps->num; i++) { | 1589 | for (i = 0; i < tvps->num; i++) { |
1590 | (tvp + i)->result = dtv_property_process_get(fe, tvp + i, inode, file); | 1590 | (tvp + i)->result = dtv_property_process_get(fe, tvp + i, file); |
1591 | err |= (tvp + i)->result; | 1591 | err |= (tvp + i)->result; |
1592 | } | 1592 | } |
1593 | 1593 | ||
@@ -1604,7 +1604,7 @@ out: | |||
1604 | return err; | 1604 | return err; |
1605 | } | 1605 | } |
1606 | 1606 | ||
1607 | static int dvb_frontend_ioctl_legacy(struct inode *inode, struct file *file, | 1607 | static int dvb_frontend_ioctl_legacy(struct file *file, |
1608 | unsigned int cmd, void *parg) | 1608 | unsigned int cmd, void *parg) |
1609 | { | 1609 | { |
1610 | struct dvb_device *dvbdev = file->private_data; | 1610 | struct dvb_device *dvbdev = file->private_data; |
@@ -2031,7 +2031,7 @@ static int dvb_frontend_release(struct inode *inode, struct file *file) | |||
2031 | 2031 | ||
2032 | static const struct file_operations dvb_frontend_fops = { | 2032 | static const struct file_operations dvb_frontend_fops = { |
2033 | .owner = THIS_MODULE, | 2033 | .owner = THIS_MODULE, |
2034 | .ioctl = dvb_generic_ioctl, | 2034 | .unlocked_ioctl = dvb_generic_ioctl, |
2035 | .poll = dvb_frontend_poll, | 2035 | .poll = dvb_frontend_poll, |
2036 | .open = dvb_frontend_open, | 2036 | .open = dvb_frontend_open, |
2037 | .release = dvb_frontend_release | 2037 | .release = dvb_frontend_release |
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c index cccea412088b..f6dac2bb0ac6 100644 --- a/drivers/media/dvb/dvb-core/dvb_net.c +++ b/drivers/media/dvb/dvb-core/dvb_net.c | |||
@@ -59,6 +59,7 @@ | |||
59 | #include <linux/netdevice.h> | 59 | #include <linux/netdevice.h> |
60 | #include <linux/etherdevice.h> | 60 | #include <linux/etherdevice.h> |
61 | #include <linux/dvb/net.h> | 61 | #include <linux/dvb/net.h> |
62 | #include <linux/smp_lock.h> | ||
62 | #include <linux/uio.h> | 63 | #include <linux/uio.h> |
63 | #include <asm/uaccess.h> | 64 | #include <asm/uaccess.h> |
64 | #include <linux/crc32.h> | 65 | #include <linux/crc32.h> |
@@ -1329,7 +1330,7 @@ static int dvb_net_remove_if(struct dvb_net *dvbnet, unsigned long num) | |||
1329 | return 0; | 1330 | return 0; |
1330 | } | 1331 | } |
1331 | 1332 | ||
1332 | static int dvb_net_do_ioctl(struct inode *inode, struct file *file, | 1333 | static int dvb_net_do_ioctl(struct file *file, |
1333 | unsigned int cmd, void *parg) | 1334 | unsigned int cmd, void *parg) |
1334 | { | 1335 | { |
1335 | struct dvb_device *dvbdev = file->private_data; | 1336 | struct dvb_device *dvbdev = file->private_data; |
@@ -1431,10 +1432,16 @@ static int dvb_net_do_ioctl(struct inode *inode, struct file *file, | |||
1431 | return 0; | 1432 | return 0; |
1432 | } | 1433 | } |
1433 | 1434 | ||
1434 | static int dvb_net_ioctl(struct inode *inode, struct file *file, | 1435 | static long dvb_net_ioctl(struct file *file, |
1435 | unsigned int cmd, unsigned long arg) | 1436 | unsigned int cmd, unsigned long arg) |
1436 | { | 1437 | { |
1437 | return dvb_usercopy(inode, file, cmd, arg, dvb_net_do_ioctl); | 1438 | int ret; |
1439 | |||
1440 | lock_kernel(); | ||
1441 | ret = dvb_usercopy(file, cmd, arg, dvb_net_do_ioctl); | ||
1442 | unlock_kernel(); | ||
1443 | |||
1444 | return ret; | ||
1438 | } | 1445 | } |
1439 | 1446 | ||
1440 | static int dvb_net_close(struct inode *inode, struct file *file) | 1447 | static int dvb_net_close(struct inode *inode, struct file *file) |
@@ -1455,7 +1462,7 @@ static int dvb_net_close(struct inode *inode, struct file *file) | |||
1455 | 1462 | ||
1456 | static const struct file_operations dvb_net_fops = { | 1463 | static const struct file_operations dvb_net_fops = { |
1457 | .owner = THIS_MODULE, | 1464 | .owner = THIS_MODULE, |
1458 | .ioctl = dvb_net_ioctl, | 1465 | .unlocked_ioctl = dvb_net_ioctl, |
1459 | .open = dvb_generic_open, | 1466 | .open = dvb_generic_open, |
1460 | .release = dvb_net_close, | 1467 | .release = dvb_net_close, |
1461 | }; | 1468 | }; |
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index 94159b90f733..b915c39d782f 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
@@ -154,10 +154,11 @@ int dvb_generic_release(struct inode *inode, struct file *file) | |||
154 | EXPORT_SYMBOL(dvb_generic_release); | 154 | EXPORT_SYMBOL(dvb_generic_release); |
155 | 155 | ||
156 | 156 | ||
157 | int dvb_generic_ioctl(struct inode *inode, struct file *file, | 157 | long dvb_generic_ioctl(struct file *file, |
158 | unsigned int cmd, unsigned long arg) | 158 | unsigned int cmd, unsigned long arg) |
159 | { | 159 | { |
160 | struct dvb_device *dvbdev = file->private_data; | 160 | struct dvb_device *dvbdev = file->private_data; |
161 | int ret; | ||
161 | 162 | ||
162 | if (!dvbdev) | 163 | if (!dvbdev) |
163 | return -ENODEV; | 164 | return -ENODEV; |
@@ -165,7 +166,11 @@ int dvb_generic_ioctl(struct inode *inode, struct file *file, | |||
165 | if (!dvbdev->kernel_ioctl) | 166 | if (!dvbdev->kernel_ioctl) |
166 | return -EINVAL; | 167 | return -EINVAL; |
167 | 168 | ||
168 | return dvb_usercopy (inode, file, cmd, arg, dvbdev->kernel_ioctl); | 169 | lock_kernel(); |
170 | ret = dvb_usercopy(file, cmd, arg, dvbdev->kernel_ioctl); | ||
171 | unlock_kernel(); | ||
172 | |||
173 | return ret; | ||
169 | } | 174 | } |
170 | EXPORT_SYMBOL(dvb_generic_ioctl); | 175 | EXPORT_SYMBOL(dvb_generic_ioctl); |
171 | 176 | ||
@@ -377,9 +382,9 @@ EXPORT_SYMBOL(dvb_unregister_adapter); | |||
377 | define this as video_usercopy(). this will introduce a dependecy | 382 | define this as video_usercopy(). this will introduce a dependecy |
378 | to the v4l "videodev.o" module, which is unnecessary for some | 383 | to the v4l "videodev.o" module, which is unnecessary for some |
379 | cards (ie. the budget dvb-cards don't need the v4l module...) */ | 384 | cards (ie. the budget dvb-cards don't need the v4l module...) */ |
380 | int dvb_usercopy(struct inode *inode, struct file *file, | 385 | int dvb_usercopy(struct file *file, |
381 | unsigned int cmd, unsigned long arg, | 386 | unsigned int cmd, unsigned long arg, |
382 | int (*func)(struct inode *inode, struct file *file, | 387 | int (*func)(struct file *file, |
383 | unsigned int cmd, void *arg)) | 388 | unsigned int cmd, void *arg)) |
384 | { | 389 | { |
385 | char sbuf[128]; | 390 | char sbuf[128]; |
@@ -416,7 +421,7 @@ int dvb_usercopy(struct inode *inode, struct file *file, | |||
416 | } | 421 | } |
417 | 422 | ||
418 | /* call driver */ | 423 | /* call driver */ |
419 | if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD) | 424 | if ((err = func(file, cmd, parg)) == -ENOIOCTLCMD) |
420 | err = -EINVAL; | 425 | err = -EINVAL; |
421 | 426 | ||
422 | if (err < 0) | 427 | if (err < 0) |
diff --git a/drivers/media/dvb/dvb-core/dvbdev.h b/drivers/media/dvb/dvb-core/dvbdev.h index f7b499d4a3c0..fcc6ae98745e 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.h +++ b/drivers/media/dvb/dvb-core/dvbdev.h | |||
@@ -116,8 +116,7 @@ struct dvb_device { | |||
116 | 116 | ||
117 | wait_queue_head_t wait_queue; | 117 | wait_queue_head_t wait_queue; |
118 | /* don't really need those !? -- FIXME: use video_usercopy */ | 118 | /* don't really need those !? -- FIXME: use video_usercopy */ |
119 | int (*kernel_ioctl)(struct inode *inode, struct file *file, | 119 | int (*kernel_ioctl)(struct file *file, unsigned int cmd, void *arg); |
120 | unsigned int cmd, void *arg); | ||
121 | 120 | ||
122 | void *priv; | 121 | void *priv; |
123 | }; | 122 | }; |
@@ -138,17 +137,15 @@ extern void dvb_unregister_device (struct dvb_device *dvbdev); | |||
138 | 137 | ||
139 | extern int dvb_generic_open (struct inode *inode, struct file *file); | 138 | extern int dvb_generic_open (struct inode *inode, struct file *file); |
140 | extern int dvb_generic_release (struct inode *inode, struct file *file); | 139 | extern int dvb_generic_release (struct inode *inode, struct file *file); |
141 | extern int dvb_generic_ioctl (struct inode *inode, struct file *file, | 140 | extern long dvb_generic_ioctl (struct file *file, |
142 | unsigned int cmd, unsigned long arg); | 141 | unsigned int cmd, unsigned long arg); |
143 | 142 | ||
144 | /* we don't mess with video_usercopy() any more, | 143 | /* we don't mess with video_usercopy() any more, |
145 | we simply define out own dvb_usercopy(), which will hopefully become | 144 | we simply define out own dvb_usercopy(), which will hopefully become |
146 | generic_usercopy() someday... */ | 145 | generic_usercopy() someday... */ |
147 | 146 | ||
148 | extern int dvb_usercopy(struct inode *inode, struct file *file, | 147 | extern int dvb_usercopy(struct file *file, unsigned int cmd, unsigned long arg, |
149 | unsigned int cmd, unsigned long arg, | 148 | int (*func)(struct file *file, unsigned int cmd, void *arg)); |
150 | int (*func)(struct inode *inode, struct file *file, | ||
151 | unsigned int cmd, void *arg)); | ||
152 | 149 | ||
153 | /** generic DVB attach function. */ | 150 | /** generic DVB attach function. */ |
154 | #ifdef CONFIG_MEDIA_ATTACH | 151 | #ifdef CONFIG_MEDIA_ATTACH |
diff --git a/drivers/media/dvb/firewire/firedtv-ci.c b/drivers/media/dvb/firewire/firedtv-ci.c index 853e04b7cb36..d3c2cf60de76 100644 --- a/drivers/media/dvb/firewire/firedtv-ci.c +++ b/drivers/media/dvb/firewire/firedtv-ci.c | |||
@@ -175,8 +175,7 @@ static int fdtv_ca_send_msg(struct firedtv *fdtv, void *arg) | |||
175 | return err; | 175 | return err; |
176 | } | 176 | } |
177 | 177 | ||
178 | static int fdtv_ca_ioctl(struct inode *inode, struct file *file, | 178 | static int fdtv_ca_ioctl(struct file *file, unsigned int cmd, void *arg) |
179 | unsigned int cmd, void *arg) | ||
180 | { | 179 | { |
181 | struct dvb_device *dvbdev = file->private_data; | 180 | struct dvb_device *dvbdev = file->private_data; |
182 | struct firedtv *fdtv = dvbdev->priv; | 181 | struct firedtv *fdtv = dvbdev->priv; |
@@ -217,7 +216,7 @@ static unsigned int fdtv_ca_io_poll(struct file *file, poll_table *wait) | |||
217 | 216 | ||
218 | static const struct file_operations fdtv_ca_fops = { | 217 | static const struct file_operations fdtv_ca_fops = { |
219 | .owner = THIS_MODULE, | 218 | .owner = THIS_MODULE, |
220 | .ioctl = dvb_generic_ioctl, | 219 | .unlocked_ioctl = dvb_generic_ioctl, |
221 | .open = dvb_generic_open, | 220 | .open = dvb_generic_open, |
222 | .release = dvb_generic_release, | 221 | .release = dvb_generic_release, |
223 | .poll = fdtv_ca_io_poll, | 222 | .poll = fdtv_ca_io_poll, |
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c index 38915591c6e5..a6be529eec5c 100644 --- a/drivers/media/dvb/ttpci/av7110.c +++ b/drivers/media/dvb/ttpci/av7110.c | |||
@@ -708,7 +708,7 @@ static void gpioirq(unsigned long cookie) | |||
708 | 708 | ||
709 | 709 | ||
710 | #ifdef CONFIG_DVB_AV7110_OSD | 710 | #ifdef CONFIG_DVB_AV7110_OSD |
711 | static int dvb_osd_ioctl(struct inode *inode, struct file *file, | 711 | static int dvb_osd_ioctl(struct file *file, |
712 | unsigned int cmd, void *parg) | 712 | unsigned int cmd, void *parg) |
713 | { | 713 | { |
714 | struct dvb_device *dvbdev = file->private_data; | 714 | struct dvb_device *dvbdev = file->private_data; |
@@ -727,7 +727,7 @@ static int dvb_osd_ioctl(struct inode *inode, struct file *file, | |||
727 | 727 | ||
728 | static const struct file_operations dvb_osd_fops = { | 728 | static const struct file_operations dvb_osd_fops = { |
729 | .owner = THIS_MODULE, | 729 | .owner = THIS_MODULE, |
730 | .ioctl = dvb_generic_ioctl, | 730 | .unlocked_ioctl = dvb_generic_ioctl, |
731 | .open = dvb_generic_open, | 731 | .open = dvb_generic_open, |
732 | .release = dvb_generic_release, | 732 | .release = dvb_generic_release, |
733 | }; | 733 | }; |
diff --git a/drivers/media/dvb/ttpci/av7110_av.c b/drivers/media/dvb/ttpci/av7110_av.c index 53884814161c..13efba942dac 100644 --- a/drivers/media/dvb/ttpci/av7110_av.c +++ b/drivers/media/dvb/ttpci/av7110_av.c | |||
@@ -1089,7 +1089,7 @@ static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len | |||
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | 1091 | ||
1092 | static int dvb_video_ioctl(struct inode *inode, struct file *file, | 1092 | static int dvb_video_ioctl(struct file *file, |
1093 | unsigned int cmd, void *parg) | 1093 | unsigned int cmd, void *parg) |
1094 | { | 1094 | { |
1095 | struct dvb_device *dvbdev = file->private_data; | 1095 | struct dvb_device *dvbdev = file->private_data; |
@@ -1297,7 +1297,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file, | |||
1297 | return ret; | 1297 | return ret; |
1298 | } | 1298 | } |
1299 | 1299 | ||
1300 | static int dvb_audio_ioctl(struct inode *inode, struct file *file, | 1300 | static int dvb_audio_ioctl(struct file *file, |
1301 | unsigned int cmd, void *parg) | 1301 | unsigned int cmd, void *parg) |
1302 | { | 1302 | { |
1303 | struct dvb_device *dvbdev = file->private_data; | 1303 | struct dvb_device *dvbdev = file->private_data; |
@@ -1517,7 +1517,7 @@ static int dvb_audio_release(struct inode *inode, struct file *file) | |||
1517 | static const struct file_operations dvb_video_fops = { | 1517 | static const struct file_operations dvb_video_fops = { |
1518 | .owner = THIS_MODULE, | 1518 | .owner = THIS_MODULE, |
1519 | .write = dvb_video_write, | 1519 | .write = dvb_video_write, |
1520 | .ioctl = dvb_generic_ioctl, | 1520 | .unlocked_ioctl = dvb_generic_ioctl, |
1521 | .open = dvb_video_open, | 1521 | .open = dvb_video_open, |
1522 | .release = dvb_video_release, | 1522 | .release = dvb_video_release, |
1523 | .poll = dvb_video_poll, | 1523 | .poll = dvb_video_poll, |
@@ -1535,7 +1535,7 @@ static struct dvb_device dvbdev_video = { | |||
1535 | static const struct file_operations dvb_audio_fops = { | 1535 | static const struct file_operations dvb_audio_fops = { |
1536 | .owner = THIS_MODULE, | 1536 | .owner = THIS_MODULE, |
1537 | .write = dvb_audio_write, | 1537 | .write = dvb_audio_write, |
1538 | .ioctl = dvb_generic_ioctl, | 1538 | .unlocked_ioctl = dvb_generic_ioctl, |
1539 | .open = dvb_audio_open, | 1539 | .open = dvb_audio_open, |
1540 | .release = dvb_audio_release, | 1540 | .release = dvb_audio_release, |
1541 | .poll = dvb_audio_poll, | 1541 | .poll = dvb_audio_poll, |
diff --git a/drivers/media/dvb/ttpci/av7110_ca.c b/drivers/media/dvb/ttpci/av7110_ca.c index ac7779c45c5b..4eba35a018e3 100644 --- a/drivers/media/dvb/ttpci/av7110_ca.c +++ b/drivers/media/dvb/ttpci/av7110_ca.c | |||
@@ -248,8 +248,7 @@ static unsigned int dvb_ca_poll (struct file *file, poll_table *wait) | |||
248 | return mask; | 248 | return mask; |
249 | } | 249 | } |
250 | 250 | ||
251 | static int dvb_ca_ioctl(struct inode *inode, struct file *file, | 251 | static int dvb_ca_ioctl(struct file *file, unsigned int cmd, void *parg) |
252 | unsigned int cmd, void *parg) | ||
253 | { | 252 | { |
254 | struct dvb_device *dvbdev = file->private_data; | 253 | struct dvb_device *dvbdev = file->private_data; |
255 | struct av7110 *av7110 = dvbdev->priv; | 254 | struct av7110 *av7110 = dvbdev->priv; |
@@ -350,7 +349,7 @@ static const struct file_operations dvb_ca_fops = { | |||
350 | .owner = THIS_MODULE, | 349 | .owner = THIS_MODULE, |
351 | .read = dvb_ca_read, | 350 | .read = dvb_ca_read, |
352 | .write = dvb_ca_write, | 351 | .write = dvb_ca_write, |
353 | .ioctl = dvb_generic_ioctl, | 352 | .unlocked_ioctl = dvb_generic_ioctl, |
354 | .open = dvb_ca_open, | 353 | .open = dvb_ca_open, |
355 | .release = dvb_generic_release, | 354 | .release = dvb_generic_release, |
356 | .poll = dvb_ca_poll, | 355 | .poll = dvb_ca_poll, |
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 8bb5e4a66328..000d65ea55a4 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -468,8 +468,7 @@ static int mtd_do_readoob(struct mtd_info *mtd, uint64_t start, | |||
468 | return ret; | 468 | return ret; |
469 | } | 469 | } |
470 | 470 | ||
471 | static int mtd_ioctl(struct inode *inode, struct file *file, | 471 | static int mtd_ioctl(struct file *file, u_int cmd, u_long arg) |
472 | u_int cmd, u_long arg) | ||
473 | { | 472 | { |
474 | struct mtd_file_info *mfi = file->private_data; | 473 | struct mtd_file_info *mfi = file->private_data; |
475 | struct mtd_info *mtd = mfi->mtd; | 474 | struct mtd_info *mtd = mfi->mtd; |
@@ -840,6 +839,17 @@ static int mtd_ioctl(struct inode *inode, struct file *file, | |||
840 | return ret; | 839 | return ret; |
841 | } /* memory_ioctl */ | 840 | } /* memory_ioctl */ |
842 | 841 | ||
842 | static long mtd_unlocked_ioctl(struct file *file, u_int cmd, u_long arg) | ||
843 | { | ||
844 | int ret; | ||
845 | |||
846 | lock_kernel(); | ||
847 | ret = mtd_ioctl(file, cmd, arg); | ||
848 | unlock_kernel(); | ||
849 | |||
850 | return ret; | ||
851 | } | ||
852 | |||
843 | #ifdef CONFIG_COMPAT | 853 | #ifdef CONFIG_COMPAT |
844 | 854 | ||
845 | struct mtd_oob_buf32 { | 855 | struct mtd_oob_buf32 { |
@@ -854,7 +864,6 @@ struct mtd_oob_buf32 { | |||
854 | static long mtd_compat_ioctl(struct file *file, unsigned int cmd, | 864 | static long mtd_compat_ioctl(struct file *file, unsigned int cmd, |
855 | unsigned long arg) | 865 | unsigned long arg) |
856 | { | 866 | { |
857 | struct inode *inode = file->f_path.dentry->d_inode; | ||
858 | struct mtd_file_info *mfi = file->private_data; | 867 | struct mtd_file_info *mfi = file->private_data; |
859 | struct mtd_info *mtd = mfi->mtd; | 868 | struct mtd_info *mtd = mfi->mtd; |
860 | void __user *argp = compat_ptr(arg); | 869 | void __user *argp = compat_ptr(arg); |
@@ -892,7 +901,7 @@ static long mtd_compat_ioctl(struct file *file, unsigned int cmd, | |||
892 | break; | 901 | break; |
893 | } | 902 | } |
894 | default: | 903 | default: |
895 | ret = mtd_ioctl(inode, file, cmd, (unsigned long)argp); | 904 | ret = mtd_ioctl(file, cmd, (unsigned long)argp); |
896 | } | 905 | } |
897 | 906 | ||
898 | unlock_kernel(); | 907 | unlock_kernel(); |
@@ -960,7 +969,7 @@ static const struct file_operations mtd_fops = { | |||
960 | .llseek = mtd_lseek, | 969 | .llseek = mtd_lseek, |
961 | .read = mtd_read, | 970 | .read = mtd_read, |
962 | .write = mtd_write, | 971 | .write = mtd_write, |
963 | .ioctl = mtd_ioctl, | 972 | .unlocked_ioctl = mtd_unlocked_ioctl, |
964 | #ifdef CONFIG_COMPAT | 973 | #ifdef CONFIG_COMPAT |
965 | .compat_ioctl = mtd_compat_ioctl, | 974 | .compat_ioctl = mtd_compat_ioctl, |
966 | #endif | 975 | #endif |
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c index ef0c5f133691..d007a2a03830 100644 --- a/drivers/pcmcia/pcmcia_ioctl.c +++ b/drivers/pcmcia/pcmcia_ioctl.c | |||
@@ -813,8 +813,7 @@ static u_int ds_poll(struct file *file, poll_table *wait) | |||
813 | 813 | ||
814 | /*====================================================================*/ | 814 | /*====================================================================*/ |
815 | 815 | ||
816 | static int ds_ioctl(struct inode *inode, struct file *file, | 816 | static int ds_ioctl(struct file *file, u_int cmd, u_long arg) |
817 | u_int cmd, u_long arg) | ||
818 | { | 817 | { |
819 | struct pcmcia_socket *s; | 818 | struct pcmcia_socket *s; |
820 | void __user *uarg = (char __user *)arg; | 819 | void __user *uarg = (char __user *)arg; |
@@ -1021,13 +1020,25 @@ free_out: | |||
1021 | return err; | 1020 | return err; |
1022 | } /* ds_ioctl */ | 1021 | } /* ds_ioctl */ |
1023 | 1022 | ||
1023 | static long ds_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
1024 | { | ||
1025 | int ret; | ||
1026 | |||
1027 | lock_kernel(); | ||
1028 | ret = ds_ioctl(file, cmd, arg); | ||
1029 | unlock_kernel(); | ||
1030 | |||
1031 | return ret; | ||
1032 | } | ||
1033 | |||
1034 | |||
1024 | /*====================================================================*/ | 1035 | /*====================================================================*/ |
1025 | 1036 | ||
1026 | static const struct file_operations ds_fops = { | 1037 | static const struct file_operations ds_fops = { |
1027 | .owner = THIS_MODULE, | 1038 | .owner = THIS_MODULE, |
1028 | .open = ds_open, | 1039 | .open = ds_open, |
1029 | .release = ds_release, | 1040 | .release = ds_release, |
1030 | .ioctl = ds_ioctl, | 1041 | .unlocked_ioctl = ds_unlocked_ioctl, |
1031 | .read = ds_read, | 1042 | .read = ds_read, |
1032 | .write = ds_write, | 1043 | .write = ds_write, |
1033 | .poll = ds_poll, | 1044 | .poll = ds_poll, |
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index 60fe266f0f49..038095d99976 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c | |||
@@ -623,7 +623,7 @@ static ssize_t wdt_read(struct file *file, char __user *buf, | |||
623 | * according to their available features. We only actually usefully support | 623 | * according to their available features. We only actually usefully support |
624 | * querying capabilities and current status. | 624 | * querying capabilities and current status. |
625 | */ | 625 | */ |
626 | static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | 626 | static int wdt_ioctl(struct file *file, unsigned int cmd, |
627 | unsigned long arg) | 627 | unsigned long arg) |
628 | { | 628 | { |
629 | int new_margin, rv; | 629 | int new_margin, rv; |
@@ -676,6 +676,18 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
676 | return -ENOTTY; | 676 | return -ENOTTY; |
677 | } | 677 | } |
678 | 678 | ||
679 | static long wdt_unlocked_ioctl(struct file *file, unsigned int cmd, | ||
680 | unsigned long arg) | ||
681 | { | ||
682 | int ret; | ||
683 | |||
684 | lock_kernel(); | ||
685 | ret = wdt_ioctl(file, cmd, arg); | ||
686 | unlock_kernel(); | ||
687 | |||
688 | return ret; | ||
689 | } | ||
690 | |||
679 | /** | 691 | /** |
680 | * wdt_open: | 692 | * wdt_open: |
681 | * @inode: inode of device | 693 | * @inode: inode of device |
@@ -736,7 +748,7 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code, | |||
736 | static const struct file_operations wdt_fops = { | 748 | static const struct file_operations wdt_fops = { |
737 | .owner = THIS_MODULE, | 749 | .owner = THIS_MODULE, |
738 | .read = wdt_read, | 750 | .read = wdt_read, |
739 | .ioctl = wdt_ioctl, | 751 | .unlocked_ioctl = wdt_unlocked_ioctl, |
740 | .write = wdt_write, | 752 | .write = wdt_write, |
741 | .open = wdt_open, | 753 | .open = wdt_open, |
742 | .release = wdt_release, | 754 | .release = wdt_release, |
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index fc2f676e984d..d53e62ab09da 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c | |||
@@ -298,9 +298,9 @@ static int opromgetbootargs(void __user *argp, struct openpromio *op, int bufsiz | |||
298 | /* | 298 | /* |
299 | * SunOS and Solaris /dev/openprom ioctl calls. | 299 | * SunOS and Solaris /dev/openprom ioctl calls. |
300 | */ | 300 | */ |
301 | static int openprom_sunos_ioctl(struct inode * inode, struct file * file, | 301 | static long openprom_sunos_ioctl(struct file * file, |
302 | unsigned int cmd, unsigned long arg, | 302 | unsigned int cmd, unsigned long arg, |
303 | struct device_node *dp) | 303 | struct device_node *dp) |
304 | { | 304 | { |
305 | DATA *data = file->private_data; | 305 | DATA *data = file->private_data; |
306 | struct openpromio *opp = NULL; | 306 | struct openpromio *opp = NULL; |
@@ -316,6 +316,8 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file, | |||
316 | if (bufsize < 0) | 316 | if (bufsize < 0) |
317 | return bufsize; | 317 | return bufsize; |
318 | 318 | ||
319 | lock_kernel(); | ||
320 | |||
319 | switch (cmd) { | 321 | switch (cmd) { |
320 | case OPROMGETOPT: | 322 | case OPROMGETOPT: |
321 | case OPROMGETPROP: | 323 | case OPROMGETPROP: |
@@ -365,6 +367,8 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file, | |||
365 | } | 367 | } |
366 | 368 | ||
367 | kfree(opp); | 369 | kfree(opp); |
370 | unlock_kernel(); | ||
371 | |||
368 | return error; | 372 | return error; |
369 | } | 373 | } |
370 | 374 | ||
@@ -547,13 +551,14 @@ static int opiocgetnext(unsigned int cmd, void __user *argp) | |||
547 | return 0; | 551 | return 0; |
548 | } | 552 | } |
549 | 553 | ||
550 | static int openprom_bsd_ioctl(struct inode * inode, struct file * file, | 554 | static int openprom_bsd_ioctl(struct file * file, |
551 | unsigned int cmd, unsigned long arg) | 555 | unsigned int cmd, unsigned long arg) |
552 | { | 556 | { |
553 | DATA *data = (DATA *) file->private_data; | 557 | DATA *data = (DATA *) file->private_data; |
554 | void __user *argp = (void __user *)arg; | 558 | void __user *argp = (void __user *)arg; |
555 | int err; | 559 | int err; |
556 | 560 | ||
561 | lock_kernel(); | ||
557 | switch (cmd) { | 562 | switch (cmd) { |
558 | case OPIOCGET: | 563 | case OPIOCGET: |
559 | err = opiocget(argp, data); | 564 | err = opiocget(argp, data); |
@@ -570,10 +575,10 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file, | |||
570 | case OPIOCGETOPTNODE: | 575 | case OPIOCGETOPTNODE: |
571 | BUILD_BUG_ON(sizeof(phandle) != sizeof(int)); | 576 | BUILD_BUG_ON(sizeof(phandle) != sizeof(int)); |
572 | 577 | ||
578 | err = 0; | ||
573 | if (copy_to_user(argp, &options_node->phandle, sizeof(phandle))) | 579 | if (copy_to_user(argp, &options_node->phandle, sizeof(phandle))) |
574 | return -EFAULT; | 580 | err = -EFAULT; |
575 | 581 | break; | |
576 | return 0; | ||
577 | 582 | ||
578 | case OPIOCGETNEXT: | 583 | case OPIOCGETNEXT: |
579 | case OPIOCGETCHILD: | 584 | case OPIOCGETCHILD: |
@@ -581,9 +586,10 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file, | |||
581 | break; | 586 | break; |
582 | 587 | ||
583 | default: | 588 | default: |
584 | return -EINVAL; | 589 | err = -EINVAL; |
585 | 590 | break; | |
586 | }; | 591 | }; |
592 | unlock_kernel(); | ||
587 | 593 | ||
588 | return err; | 594 | return err; |
589 | } | 595 | } |
@@ -592,8 +598,8 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file, | |||
592 | /* | 598 | /* |
593 | * Handoff control to the correct ioctl handler. | 599 | * Handoff control to the correct ioctl handler. |
594 | */ | 600 | */ |
595 | static int openprom_ioctl(struct inode * inode, struct file * file, | 601 | static long openprom_ioctl(struct file * file, |
596 | unsigned int cmd, unsigned long arg) | 602 | unsigned int cmd, unsigned long arg) |
597 | { | 603 | { |
598 | DATA *data = (DATA *) file->private_data; | 604 | DATA *data = (DATA *) file->private_data; |
599 | 605 | ||
@@ -602,14 +608,14 @@ static int openprom_ioctl(struct inode * inode, struct file * file, | |||
602 | case OPROMNXTOPT: | 608 | case OPROMNXTOPT: |
603 | if ((file->f_mode & FMODE_READ) == 0) | 609 | if ((file->f_mode & FMODE_READ) == 0) |
604 | return -EPERM; | 610 | return -EPERM; |
605 | return openprom_sunos_ioctl(inode, file, cmd, arg, | 611 | return openprom_sunos_ioctl(file, cmd, arg, |
606 | options_node); | 612 | options_node); |
607 | 613 | ||
608 | case OPROMSETOPT: | 614 | case OPROMSETOPT: |
609 | case OPROMSETOPT2: | 615 | case OPROMSETOPT2: |
610 | if ((file->f_mode & FMODE_WRITE) == 0) | 616 | if ((file->f_mode & FMODE_WRITE) == 0) |
611 | return -EPERM; | 617 | return -EPERM; |
612 | return openprom_sunos_ioctl(inode, file, cmd, arg, | 618 | return openprom_sunos_ioctl(file, cmd, arg, |
613 | options_node); | 619 | options_node); |
614 | 620 | ||
615 | case OPROMNEXT: | 621 | case OPROMNEXT: |
@@ -618,7 +624,7 @@ static int openprom_ioctl(struct inode * inode, struct file * file, | |||
618 | case OPROMNXTPROP: | 624 | case OPROMNXTPROP: |
619 | if ((file->f_mode & FMODE_READ) == 0) | 625 | if ((file->f_mode & FMODE_READ) == 0) |
620 | return -EPERM; | 626 | return -EPERM; |
621 | return openprom_sunos_ioctl(inode, file, cmd, arg, | 627 | return openprom_sunos_ioctl(file, cmd, arg, |
622 | data->current_node); | 628 | data->current_node); |
623 | 629 | ||
624 | case OPROMU2P: | 630 | case OPROMU2P: |
@@ -630,7 +636,7 @@ static int openprom_ioctl(struct inode * inode, struct file * file, | |||
630 | case OPROMPATH2NODE: | 636 | case OPROMPATH2NODE: |
631 | if ((file->f_mode & FMODE_READ) == 0) | 637 | if ((file->f_mode & FMODE_READ) == 0) |
632 | return -EPERM; | 638 | return -EPERM; |
633 | return openprom_sunos_ioctl(inode, file, cmd, arg, NULL); | 639 | return openprom_sunos_ioctl(file, cmd, arg, NULL); |
634 | 640 | ||
635 | case OPIOCGET: | 641 | case OPIOCGET: |
636 | case OPIOCNEXTPROP: | 642 | case OPIOCNEXTPROP: |
@@ -639,12 +645,12 @@ static int openprom_ioctl(struct inode * inode, struct file * file, | |||
639 | case OPIOCGETCHILD: | 645 | case OPIOCGETCHILD: |
640 | if ((file->f_mode & FMODE_READ) == 0) | 646 | if ((file->f_mode & FMODE_READ) == 0) |
641 | return -EBADF; | 647 | return -EBADF; |
642 | return openprom_bsd_ioctl(inode,file,cmd,arg); | 648 | return openprom_bsd_ioctl(file,cmd,arg); |
643 | 649 | ||
644 | case OPIOCSET: | 650 | case OPIOCSET: |
645 | if ((file->f_mode & FMODE_WRITE) == 0) | 651 | if ((file->f_mode & FMODE_WRITE) == 0) |
646 | return -EBADF; | 652 | return -EBADF; |
647 | return openprom_bsd_ioctl(inode,file,cmd,arg); | 653 | return openprom_bsd_ioctl(file,cmd,arg); |
648 | 654 | ||
649 | default: | 655 | default: |
650 | return -EINVAL; | 656 | return -EINVAL; |
@@ -676,7 +682,7 @@ static long openprom_compat_ioctl(struct file *file, unsigned int cmd, | |||
676 | case OPROMSETCUR: | 682 | case OPROMSETCUR: |
677 | case OPROMPCI2NODE: | 683 | case OPROMPCI2NODE: |
678 | case OPROMPATH2NODE: | 684 | case OPROMPATH2NODE: |
679 | rval = openprom_ioctl(file->f_path.dentry->d_inode, file, cmd, arg); | 685 | rval = openprom_ioctl(file, cmd, arg); |
680 | break; | 686 | break; |
681 | } | 687 | } |
682 | 688 | ||
@@ -709,7 +715,7 @@ static int openprom_release(struct inode * inode, struct file * file) | |||
709 | static const struct file_operations openprom_fops = { | 715 | static const struct file_operations openprom_fops = { |
710 | .owner = THIS_MODULE, | 716 | .owner = THIS_MODULE, |
711 | .llseek = no_llseek, | 717 | .llseek = no_llseek, |
712 | .ioctl = openprom_ioctl, | 718 | .unlocked_ioctl = openprom_ioctl, |
713 | .compat_ioctl = openprom_compat_ioctl, | 719 | .compat_ioctl = openprom_compat_ioctl, |
714 | .open = openprom_open, | 720 | .open = openprom_open, |
715 | .release = openprom_release, | 721 | .release = openprom_release, |
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index 1bb774becf25..e20b7bdd4c78 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c | |||
@@ -125,7 +125,7 @@ static void twa_aen_queue_event(TW_Device_Extension *tw_dev, TW_Command_Apache_H | |||
125 | static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id); | 125 | static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id); |
126 | static char *twa_aen_severity_lookup(unsigned char severity_code); | 126 | static char *twa_aen_severity_lookup(unsigned char severity_code); |
127 | static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id); | 127 | static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id); |
128 | static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); | 128 | static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
129 | static int twa_chrdev_open(struct inode *inode, struct file *file); | 129 | static int twa_chrdev_open(struct inode *inode, struct file *file); |
130 | static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_host); | 130 | static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_host); |
131 | static void twa_free_request_id(TW_Device_Extension *tw_dev,int request_id); | 131 | static void twa_free_request_id(TW_Device_Extension *tw_dev,int request_id); |
@@ -220,7 +220,7 @@ static struct device_attribute *twa_host_attrs[] = { | |||
220 | /* File operations struct for character device */ | 220 | /* File operations struct for character device */ |
221 | static const struct file_operations twa_fops = { | 221 | static const struct file_operations twa_fops = { |
222 | .owner = THIS_MODULE, | 222 | .owner = THIS_MODULE, |
223 | .ioctl = twa_chrdev_ioctl, | 223 | .unlocked_ioctl = twa_chrdev_ioctl, |
224 | .open = twa_chrdev_open, | 224 | .open = twa_chrdev_open, |
225 | .release = NULL | 225 | .release = NULL |
226 | }; | 226 | }; |
@@ -637,8 +637,9 @@ out: | |||
637 | } /* End twa_check_srl() */ | 637 | } /* End twa_check_srl() */ |
638 | 638 | ||
639 | /* This function handles ioctl for the character device */ | 639 | /* This function handles ioctl for the character device */ |
640 | static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 640 | static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
641 | { | 641 | { |
642 | struct inode *inode = file->f_path.dentry->d_inode; | ||
642 | long timeout; | 643 | long timeout; |
643 | unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0; | 644 | unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0; |
644 | dma_addr_t dma_handle; | 645 | dma_addr_t dma_handle; |
@@ -657,6 +658,8 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int | |||
657 | int retval = TW_IOCTL_ERROR_OS_EFAULT; | 658 | int retval = TW_IOCTL_ERROR_OS_EFAULT; |
658 | void __user *argp = (void __user *)arg; | 659 | void __user *argp = (void __user *)arg; |
659 | 660 | ||
661 | lock_kernel(); | ||
662 | |||
660 | /* Only let one of these through at a time */ | 663 | /* Only let one of these through at a time */ |
661 | if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) { | 664 | if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) { |
662 | retval = TW_IOCTL_ERROR_OS_EINTR; | 665 | retval = TW_IOCTL_ERROR_OS_EINTR; |
@@ -876,6 +879,7 @@ out3: | |||
876 | out2: | 879 | out2: |
877 | mutex_unlock(&tw_dev->ioctl_lock); | 880 | mutex_unlock(&tw_dev->ioctl_lock); |
878 | out: | 881 | out: |
882 | unlock_kernel(); | ||
879 | return retval; | 883 | return retval; |
880 | } /* End twa_chrdev_ioctl() */ | 884 | } /* End twa_chrdev_ioctl() */ |
881 | 885 | ||
diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c index d38000db9237..f481e734aad4 100644 --- a/drivers/scsi/3w-sas.c +++ b/drivers/scsi/3w-sas.c | |||
@@ -750,19 +750,22 @@ static void twl_load_sgl(TW_Device_Extension *tw_dev, TW_Command_Full *full_comm | |||
750 | 750 | ||
751 | /* This function handles ioctl for the character device | 751 | /* This function handles ioctl for the character device |
752 | This interface is used by smartmontools open source software */ | 752 | This interface is used by smartmontools open source software */ |
753 | static int twl_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 753 | static long twl_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
754 | { | 754 | { |
755 | long timeout; | 755 | long timeout; |
756 | unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0; | 756 | unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0; |
757 | dma_addr_t dma_handle; | 757 | dma_addr_t dma_handle; |
758 | int request_id = 0; | 758 | int request_id = 0; |
759 | TW_Ioctl_Driver_Command driver_command; | 759 | TW_Ioctl_Driver_Command driver_command; |
760 | struct inode *inode = file->f_dentry->d_inode; | ||
760 | TW_Ioctl_Buf_Apache *tw_ioctl; | 761 | TW_Ioctl_Buf_Apache *tw_ioctl; |
761 | TW_Command_Full *full_command_packet; | 762 | TW_Command_Full *full_command_packet; |
762 | TW_Device_Extension *tw_dev = twl_device_extension_list[iminor(inode)]; | 763 | TW_Device_Extension *tw_dev = twl_device_extension_list[iminor(inode)]; |
763 | int retval = -EFAULT; | 764 | int retval = -EFAULT; |
764 | void __user *argp = (void __user *)arg; | 765 | void __user *argp = (void __user *)arg; |
765 | 766 | ||
767 | lock_kernel(); | ||
768 | |||
766 | /* Only let one of these through at a time */ | 769 | /* Only let one of these through at a time */ |
767 | if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) { | 770 | if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) { |
768 | retval = -EINTR; | 771 | retval = -EINTR; |
@@ -858,6 +861,7 @@ out3: | |||
858 | out2: | 861 | out2: |
859 | mutex_unlock(&tw_dev->ioctl_lock); | 862 | mutex_unlock(&tw_dev->ioctl_lock); |
860 | out: | 863 | out: |
864 | unlock_kernel(); | ||
861 | return retval; | 865 | return retval; |
862 | } /* End twl_chrdev_ioctl() */ | 866 | } /* End twl_chrdev_ioctl() */ |
863 | 867 | ||
@@ -884,7 +888,7 @@ out: | |||
884 | /* File operations struct for character device */ | 888 | /* File operations struct for character device */ |
885 | static const struct file_operations twl_fops = { | 889 | static const struct file_operations twl_fops = { |
886 | .owner = THIS_MODULE, | 890 | .owner = THIS_MODULE, |
887 | .ioctl = twl_chrdev_ioctl, | 891 | .unlocked_ioctl = twl_chrdev_ioctl, |
888 | .open = twl_chrdev_open, | 892 | .open = twl_chrdev_open, |
889 | .release = NULL | 893 | .release = NULL |
890 | }; | 894 | }; |
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index d119a614bf7d..30d735ad35b5 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c | |||
@@ -881,7 +881,7 @@ static int tw_allocate_memory(TW_Device_Extension *tw_dev, int size, int which) | |||
881 | } /* End tw_allocate_memory() */ | 881 | } /* End tw_allocate_memory() */ |
882 | 882 | ||
883 | /* This function handles ioctl for the character device */ | 883 | /* This function handles ioctl for the character device */ |
884 | static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 884 | static long tw_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
885 | { | 885 | { |
886 | int request_id; | 886 | int request_id; |
887 | dma_addr_t dma_handle; | 887 | dma_addr_t dma_handle; |
@@ -889,6 +889,7 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int | |||
889 | unsigned long flags; | 889 | unsigned long flags; |
890 | unsigned int data_buffer_length = 0; | 890 | unsigned int data_buffer_length = 0; |
891 | unsigned long data_buffer_length_adjusted = 0; | 891 | unsigned long data_buffer_length_adjusted = 0; |
892 | struct inode *inode = file->f_dentry->d_inode; | ||
892 | unsigned long *cpu_addr; | 893 | unsigned long *cpu_addr; |
893 | long timeout; | 894 | long timeout; |
894 | TW_New_Ioctl *tw_ioctl; | 895 | TW_New_Ioctl *tw_ioctl; |
@@ -899,9 +900,12 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int | |||
899 | 900 | ||
900 | dprintk(KERN_WARNING "3w-xxxx: tw_chrdev_ioctl()\n"); | 901 | dprintk(KERN_WARNING "3w-xxxx: tw_chrdev_ioctl()\n"); |
901 | 902 | ||
903 | lock_kernel(); | ||
902 | /* Only let one of these through at a time */ | 904 | /* Only let one of these through at a time */ |
903 | if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) | 905 | if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) { |
906 | unlock_kernel(); | ||
904 | return -EINTR; | 907 | return -EINTR; |
908 | } | ||
905 | 909 | ||
906 | /* First copy down the buffer length */ | 910 | /* First copy down the buffer length */ |
907 | if (copy_from_user(&data_buffer_length, argp, sizeof(unsigned int))) | 911 | if (copy_from_user(&data_buffer_length, argp, sizeof(unsigned int))) |
@@ -1030,6 +1034,7 @@ out2: | |||
1030 | dma_free_coherent(&tw_dev->tw_pci_dev->dev, data_buffer_length_adjusted+sizeof(TW_New_Ioctl) - 1, cpu_addr, dma_handle); | 1034 | dma_free_coherent(&tw_dev->tw_pci_dev->dev, data_buffer_length_adjusted+sizeof(TW_New_Ioctl) - 1, cpu_addr, dma_handle); |
1031 | out: | 1035 | out: |
1032 | mutex_unlock(&tw_dev->ioctl_lock); | 1036 | mutex_unlock(&tw_dev->ioctl_lock); |
1037 | unlock_kernel(); | ||
1033 | return retval; | 1038 | return retval; |
1034 | } /* End tw_chrdev_ioctl() */ | 1039 | } /* End tw_chrdev_ioctl() */ |
1035 | 1040 | ||
@@ -1052,7 +1057,7 @@ static int tw_chrdev_open(struct inode *inode, struct file *file) | |||
1052 | /* File operations struct for character device */ | 1057 | /* File operations struct for character device */ |
1053 | static const struct file_operations tw_fops = { | 1058 | static const struct file_operations tw_fops = { |
1054 | .owner = THIS_MODULE, | 1059 | .owner = THIS_MODULE, |
1055 | .ioctl = tw_chrdev_ioctl, | 1060 | .unlocked_ioctl = tw_chrdev_ioctl, |
1056 | .open = tw_chrdev_open, | 1061 | .open = tw_chrdev_open, |
1057 | .release = NULL | 1062 | .release = NULL |
1058 | }; | 1063 | }; |
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index e9373a2d14fa..33898b61fdb5 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c | |||
@@ -705,12 +705,17 @@ static int aac_cfg_open(struct inode *inode, struct file *file) | |||
705 | * Bugs: Needs to handle hot plugging | 705 | * Bugs: Needs to handle hot plugging |
706 | */ | 706 | */ |
707 | 707 | ||
708 | static int aac_cfg_ioctl(struct inode *inode, struct file *file, | 708 | static long aac_cfg_ioctl(struct file *file, |
709 | unsigned int cmd, unsigned long arg) | 709 | unsigned int cmd, unsigned long arg) |
710 | { | 710 | { |
711 | int ret; | ||
711 | if (!capable(CAP_SYS_RAWIO)) | 712 | if (!capable(CAP_SYS_RAWIO)) |
712 | return -EPERM; | 713 | return -EPERM; |
713 | return aac_do_ioctl(file->private_data, cmd, (void __user *)arg); | 714 | lock_kernel(); |
715 | ret = aac_do_ioctl(file->private_data, cmd, (void __user *)arg); | ||
716 | unlock_kernel(); | ||
717 | |||
718 | return ret; | ||
714 | } | 719 | } |
715 | 720 | ||
716 | #ifdef CONFIG_COMPAT | 721 | #ifdef CONFIG_COMPAT |
@@ -1029,7 +1034,7 @@ ssize_t aac_get_serial_number(struct device *device, char *buf) | |||
1029 | 1034 | ||
1030 | static const struct file_operations aac_cfg_fops = { | 1035 | static const struct file_operations aac_cfg_fops = { |
1031 | .owner = THIS_MODULE, | 1036 | .owner = THIS_MODULE, |
1032 | .ioctl = aac_cfg_ioctl, | 1037 | .unlocked_ioctl = aac_cfg_ioctl, |
1033 | #ifdef CONFIG_COMPAT | 1038 | #ifdef CONFIG_COMPAT |
1034 | .compat_ioctl = aac_compat_cfg_ioctl, | 1039 | .compat_ioctl = aac_compat_cfg_ioctl, |
1035 | #endif | 1040 | #endif |
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 0435d044c9da..b0c576f84b28 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -114,12 +114,13 @@ static int hba_count = 0; | |||
114 | 114 | ||
115 | static struct class *adpt_sysfs_class; | 115 | static struct class *adpt_sysfs_class; |
116 | 116 | ||
117 | static long adpt_unlocked_ioctl(struct file *, unsigned int, unsigned long); | ||
117 | #ifdef CONFIG_COMPAT | 118 | #ifdef CONFIG_COMPAT |
118 | static long compat_adpt_ioctl(struct file *, unsigned int, unsigned long); | 119 | static long compat_adpt_ioctl(struct file *, unsigned int, unsigned long); |
119 | #endif | 120 | #endif |
120 | 121 | ||
121 | static const struct file_operations adpt_fops = { | 122 | static const struct file_operations adpt_fops = { |
122 | .ioctl = adpt_ioctl, | 123 | .unlocked_ioctl = adpt_unlocked_ioctl, |
123 | .open = adpt_open, | 124 | .open = adpt_open, |
124 | .release = adpt_close, | 125 | .release = adpt_close, |
125 | #ifdef CONFIG_COMPAT | 126 | #ifdef CONFIG_COMPAT |
@@ -2069,8 +2070,7 @@ static int adpt_system_info(void __user *buffer) | |||
2069 | return 0; | 2070 | return 0; |
2070 | } | 2071 | } |
2071 | 2072 | ||
2072 | static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd, | 2073 | static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg) |
2073 | ulong arg) | ||
2074 | { | 2074 | { |
2075 | int minor; | 2075 | int minor; |
2076 | int error = 0; | 2076 | int error = 0; |
@@ -2153,6 +2153,20 @@ static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd, | |||
2153 | return error; | 2153 | return error; |
2154 | } | 2154 | } |
2155 | 2155 | ||
2156 | static long adpt_unlocked_ioctl(struct file *file, uint cmd, ulong arg) | ||
2157 | { | ||
2158 | struct inode *inode; | ||
2159 | long ret; | ||
2160 | |||
2161 | inode = file->f_dentry->d_inode; | ||
2162 | |||
2163 | lock_kernel(); | ||
2164 | ret = adpt_ioctl(inode, file, cmd, arg); | ||
2165 | unlock_kernel(); | ||
2166 | |||
2167 | return ret; | ||
2168 | } | ||
2169 | |||
2156 | #ifdef CONFIG_COMPAT | 2170 | #ifdef CONFIG_COMPAT |
2157 | static long compat_adpt_ioctl(struct file *file, | 2171 | static long compat_adpt_ioctl(struct file *file, |
2158 | unsigned int cmd, unsigned long arg) | 2172 | unsigned int cmd, unsigned long arg) |
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index a765fe7a55c3..f672d6213eea 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c | |||
@@ -180,8 +180,8 @@ static const char *gdth_ctr_name(gdth_ha_str *ha); | |||
180 | 180 | ||
181 | static int gdth_open(struct inode *inode, struct file *filep); | 181 | static int gdth_open(struct inode *inode, struct file *filep); |
182 | static int gdth_close(struct inode *inode, struct file *filep); | 182 | static int gdth_close(struct inode *inode, struct file *filep); |
183 | static int gdth_ioctl(struct inode *inode, struct file *filep, | 183 | static long gdth_unlocked_ioctl(struct file *filep, unsigned int cmd, |
184 | unsigned int cmd, unsigned long arg); | 184 | unsigned long arg); |
185 | 185 | ||
186 | static void gdth_flush(gdth_ha_str *ha); | 186 | static void gdth_flush(gdth_ha_str *ha); |
187 | static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *)); | 187 | static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *)); |
@@ -369,7 +369,7 @@ MODULE_LICENSE("GPL"); | |||
369 | 369 | ||
370 | /* ioctl interface */ | 370 | /* ioctl interface */ |
371 | static const struct file_operations gdth_fops = { | 371 | static const struct file_operations gdth_fops = { |
372 | .ioctl = gdth_ioctl, | 372 | .unlocked_ioctl = gdth_unlocked_ioctl, |
373 | .open = gdth_open, | 373 | .open = gdth_open, |
374 | .release = gdth_close, | 374 | .release = gdth_close, |
375 | }; | 375 | }; |
@@ -4462,8 +4462,7 @@ free_fail: | |||
4462 | return rc; | 4462 | return rc; |
4463 | } | 4463 | } |
4464 | 4464 | ||
4465 | static int gdth_ioctl(struct inode *inode, struct file *filep, | 4465 | static int gdth_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) |
4466 | unsigned int cmd, unsigned long arg) | ||
4467 | { | 4466 | { |
4468 | gdth_ha_str *ha; | 4467 | gdth_ha_str *ha; |
4469 | Scsi_Cmnd *scp; | 4468 | Scsi_Cmnd *scp; |
@@ -4611,6 +4610,17 @@ static int gdth_ioctl(struct inode *inode, struct file *filep, | |||
4611 | return 0; | 4610 | return 0; |
4612 | } | 4611 | } |
4613 | 4612 | ||
4613 | static long gdth_unlocked_ioctl(struct file *file, unsigned int cmd, | ||
4614 | unsigned long arg) | ||
4615 | { | ||
4616 | int ret; | ||
4617 | |||
4618 | lock_kernel(); | ||
4619 | ret = gdth_ioctl(file, cmd, arg); | ||
4620 | unlock_kernel(); | ||
4621 | |||
4622 | return ret; | ||
4623 | } | ||
4614 | 4624 | ||
4615 | /* flush routine */ | 4625 | /* flush routine */ |
4616 | static void gdth_flush(gdth_ha_str *ha) | 4626 | static void gdth_flush(gdth_ha_str *ha) |
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 4bf7edca9e69..0b6e3228610a 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c | |||
@@ -91,12 +91,15 @@ static struct proc_dir_entry *mega_proc_dir_entry; | |||
91 | /* For controller re-ordering */ | 91 | /* For controller re-ordering */ |
92 | static struct mega_hbas mega_hbas[MAX_CONTROLLERS]; | 92 | static struct mega_hbas mega_hbas[MAX_CONTROLLERS]; |
93 | 93 | ||
94 | static long | ||
95 | megadev_unlocked_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); | ||
96 | |||
94 | /* | 97 | /* |
95 | * The File Operations structure for the serial/ioctl interface of the driver | 98 | * The File Operations structure for the serial/ioctl interface of the driver |
96 | */ | 99 | */ |
97 | static const struct file_operations megadev_fops = { | 100 | static const struct file_operations megadev_fops = { |
98 | .owner = THIS_MODULE, | 101 | .owner = THIS_MODULE, |
99 | .ioctl = megadev_ioctl, | 102 | .unlocked_ioctl = megadev_unlocked_ioctl, |
100 | .open = megadev_open, | 103 | .open = megadev_open, |
101 | }; | 104 | }; |
102 | 105 | ||
@@ -3302,8 +3305,7 @@ megadev_open (struct inode *inode, struct file *filep) | |||
3302 | * controller. | 3305 | * controller. |
3303 | */ | 3306 | */ |
3304 | static int | 3307 | static int |
3305 | megadev_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, | 3308 | megadev_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) |
3306 | unsigned long arg) | ||
3307 | { | 3309 | { |
3308 | adapter_t *adapter; | 3310 | adapter_t *adapter; |
3309 | nitioctl_t uioc; | 3311 | nitioctl_t uioc; |
@@ -3694,6 +3696,18 @@ freemem_and_return: | |||
3694 | return 0; | 3696 | return 0; |
3695 | } | 3697 | } |
3696 | 3698 | ||
3699 | static long | ||
3700 | megadev_unlocked_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) | ||
3701 | { | ||
3702 | int ret; | ||
3703 | |||
3704 | lock_kernel(); | ||
3705 | ret = megadev_ioctl(filep, cmd, arg); | ||
3706 | unlock_kernel(); | ||
3707 | |||
3708 | return ret; | ||
3709 | } | ||
3710 | |||
3697 | /** | 3711 | /** |
3698 | * mega_m_to_n() | 3712 | * mega_m_to_n() |
3699 | * @arg - user address | 3713 | * @arg - user address |
diff --git a/drivers/scsi/megaraid.h b/drivers/scsi/megaraid.h index d310f49d077e..2b4a048cadf1 100644 --- a/drivers/scsi/megaraid.h +++ b/drivers/scsi/megaraid.h | |||
@@ -1013,8 +1013,7 @@ static void mega_8_to_40ld (mraid_inquiry *inquiry, | |||
1013 | mega_inquiry3 *enquiry3, mega_product_info *); | 1013 | mega_inquiry3 *enquiry3, mega_product_info *); |
1014 | 1014 | ||
1015 | static int megadev_open (struct inode *, struct file *); | 1015 | static int megadev_open (struct inode *, struct file *); |
1016 | static int megadev_ioctl (struct inode *, struct file *, unsigned int, | 1016 | static int megadev_ioctl (struct file *, unsigned int, unsigned long); |
1017 | unsigned long); | ||
1018 | static int mega_m_to_n(void __user *, nitioctl_t *); | 1017 | static int mega_m_to_n(void __user *, nitioctl_t *); |
1019 | static int mega_n_to_m(void __user *, megacmd_t *); | 1018 | static int mega_n_to_m(void __user *, megacmd_t *); |
1020 | 1019 | ||
diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c index 36e0b7d05c1d..41f82f76d884 100644 --- a/drivers/scsi/megaraid/megaraid_mm.c +++ b/drivers/scsi/megaraid/megaraid_mm.c | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | // Entry points for char node driver | 23 | // Entry points for char node driver |
24 | static int mraid_mm_open(struct inode *, struct file *); | 24 | static int mraid_mm_open(struct inode *, struct file *); |
25 | static int mraid_mm_ioctl(struct inode *, struct file *, uint, unsigned long); | 25 | static long mraid_mm_unlocked_ioctl(struct file *, uint, unsigned long); |
26 | 26 | ||
27 | 27 | ||
28 | // routines to convert to and from the old the format | 28 | // routines to convert to and from the old the format |
@@ -70,7 +70,7 @@ static wait_queue_head_t wait_q; | |||
70 | 70 | ||
71 | static const struct file_operations lsi_fops = { | 71 | static const struct file_operations lsi_fops = { |
72 | .open = mraid_mm_open, | 72 | .open = mraid_mm_open, |
73 | .ioctl = mraid_mm_ioctl, | 73 | .unlocked_ioctl = mraid_mm_unlocked_ioctl, |
74 | #ifdef CONFIG_COMPAT | 74 | #ifdef CONFIG_COMPAT |
75 | .compat_ioctl = mraid_mm_compat_ioctl, | 75 | .compat_ioctl = mraid_mm_compat_ioctl, |
76 | #endif | 76 | #endif |
@@ -110,8 +110,7 @@ mraid_mm_open(struct inode *inode, struct file *filep) | |||
110 | * @arg : user ioctl packet | 110 | * @arg : user ioctl packet |
111 | */ | 111 | */ |
112 | static int | 112 | static int |
113 | mraid_mm_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, | 113 | mraid_mm_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) |
114 | unsigned long arg) | ||
115 | { | 114 | { |
116 | uioc_t *kioc; | 115 | uioc_t *kioc; |
117 | char signature[EXT_IOCTL_SIGN_SZ] = {0}; | 116 | char signature[EXT_IOCTL_SIGN_SZ] = {0}; |
@@ -218,6 +217,19 @@ mraid_mm_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, | |||
218 | return rval; | 217 | return rval; |
219 | } | 218 | } |
220 | 219 | ||
220 | static long | ||
221 | mraid_mm_unlocked_ioctl(struct file *filep, unsigned int cmd, | ||
222 | unsigned long arg) | ||
223 | { | ||
224 | int err; | ||
225 | |||
226 | /* inconsistant: mraid_mm_compat_ioctl doesn't take the BKL */ | ||
227 | lock_kernel(); | ||
228 | err = mraid_mm_ioctl(filep, cmd, arg); | ||
229 | unlock_kernel(); | ||
230 | |||
231 | return err; | ||
232 | } | ||
221 | 233 | ||
222 | /** | 234 | /** |
223 | * mraid_mm_get_adapter - Returns corresponding adapters for the mimd packet | 235 | * mraid_mm_get_adapter - Returns corresponding adapters for the mimd packet |
@@ -1225,7 +1237,7 @@ mraid_mm_compat_ioctl(struct file *filep, unsigned int cmd, | |||
1225 | { | 1237 | { |
1226 | int err; | 1238 | int err; |
1227 | 1239 | ||
1228 | err = mraid_mm_ioctl(NULL, filep, cmd, arg); | 1240 | err = mraid_mm_ioctl(filep, cmd, arg); |
1229 | 1241 | ||
1230 | return err; | 1242 | return err; |
1231 | } | 1243 | } |
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c index b219118f8bd6..8dbf1c3afb7b 100644 --- a/drivers/scsi/osst.c +++ b/drivers/scsi/osst.c | |||
@@ -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 */ |
4935 | static int osst_ioctl(struct inode * inode,struct file * file, | 4935 | static 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 | ||
5261 | out: | 5266 | out: |
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,7 +5619,7 @@ 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 |
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index dee1c96288d4..ef752b248c4d 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -758,8 +758,7 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp, | |||
758 | } | 758 | } |
759 | 759 | ||
760 | static int | 760 | static int |
761 | sg_ioctl(struct inode *inode, struct file *filp, | 761 | sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) |
762 | unsigned int cmd_in, unsigned long arg) | ||
763 | { | 762 | { |
764 | void __user *p = (void __user *)arg; | 763 | void __user *p = (void __user *)arg; |
765 | int __user *ip = p; | 764 | int __user *ip = p; |
@@ -1078,6 +1077,18 @@ sg_ioctl(struct inode *inode, struct file *filp, | |||
1078 | } | 1077 | } |
1079 | } | 1078 | } |
1080 | 1079 | ||
1080 | static long | ||
1081 | sg_unlocked_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) | ||
1082 | { | ||
1083 | int ret; | ||
1084 | |||
1085 | lock_kernel(); | ||
1086 | ret = sg_ioctl(filp, cmd_in, arg); | ||
1087 | unlock_kernel(); | ||
1088 | |||
1089 | return ret; | ||
1090 | } | ||
1091 | |||
1081 | #ifdef CONFIG_COMPAT | 1092 | #ifdef CONFIG_COMPAT |
1082 | static long sg_compat_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) | 1093 | static long sg_compat_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) |
1083 | { | 1094 | { |
@@ -1322,7 +1333,7 @@ static const struct file_operations sg_fops = { | |||
1322 | .read = sg_read, | 1333 | .read = sg_read, |
1323 | .write = sg_write, | 1334 | .write = sg_write, |
1324 | .poll = sg_poll, | 1335 | .poll = sg_poll, |
1325 | .ioctl = sg_ioctl, | 1336 | .unlocked_ioctl = sg_unlocked_ioctl, |
1326 | #ifdef CONFIG_COMPAT | 1337 | #ifdef CONFIG_COMPAT |
1327 | .compat_ioctl = sg_compat_ioctl, | 1338 | .compat_ioctl = sg_compat_ioctl, |
1328 | #endif | 1339 | #endif |
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c index e7fa3644ba6a..61c76b13f0f1 100644 --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c | |||
@@ -954,8 +954,7 @@ static int mon_bin_queued(struct mon_reader_bin *rp) | |||
954 | 954 | ||
955 | /* | 955 | /* |
956 | */ | 956 | */ |
957 | static int mon_bin_ioctl(struct inode *inode, struct file *file, | 957 | static int mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
958 | unsigned int cmd, unsigned long arg) | ||
959 | { | 958 | { |
960 | struct mon_reader_bin *rp = file->private_data; | 959 | struct mon_reader_bin *rp = file->private_data; |
961 | // struct mon_bus* mbus = rp->r.m_bus; | 960 | // struct mon_bus* mbus = rp->r.m_bus; |
@@ -1095,6 +1094,19 @@ static int mon_bin_ioctl(struct inode *inode, struct file *file, | |||
1095 | return ret; | 1094 | return ret; |
1096 | } | 1095 | } |
1097 | 1096 | ||
1097 | static long mon_bin_unlocked_ioctl(struct file *file, unsigned int cmd, | ||
1098 | unsigned long arg) | ||
1099 | { | ||
1100 | int ret; | ||
1101 | |||
1102 | lock_kernel(); | ||
1103 | ret = mon_bin_ioctl(file, cmd, arg); | ||
1104 | unlock_kernel(); | ||
1105 | |||
1106 | return ret; | ||
1107 | } | ||
1108 | |||
1109 | |||
1098 | #ifdef CONFIG_COMPAT | 1110 | #ifdef CONFIG_COMPAT |
1099 | static long mon_bin_compat_ioctl(struct file *file, | 1111 | static long mon_bin_compat_ioctl(struct file *file, |
1100 | unsigned int cmd, unsigned long arg) | 1112 | unsigned int cmd, unsigned long arg) |
@@ -1148,14 +1160,13 @@ static long mon_bin_compat_ioctl(struct file *file, | |||
1148 | return 0; | 1160 | return 0; |
1149 | 1161 | ||
1150 | case MON_IOCG_STATS: | 1162 | case MON_IOCG_STATS: |
1151 | return mon_bin_ioctl(NULL, file, cmd, | 1163 | return mon_bin_ioctl(file, cmd, (unsigned long) compat_ptr(arg)); |
1152 | (unsigned long) compat_ptr(arg)); | ||
1153 | 1164 | ||
1154 | case MON_IOCQ_URB_LEN: | 1165 | case MON_IOCQ_URB_LEN: |
1155 | case MON_IOCQ_RING_SIZE: | 1166 | case MON_IOCQ_RING_SIZE: |
1156 | case MON_IOCT_RING_SIZE: | 1167 | case MON_IOCT_RING_SIZE: |
1157 | case MON_IOCH_MFLUSH: | 1168 | case MON_IOCH_MFLUSH: |
1158 | return mon_bin_ioctl(NULL, file, cmd, arg); | 1169 | return mon_bin_ioctl(file, cmd, arg); |
1159 | 1170 | ||
1160 | default: | 1171 | default: |
1161 | ; | 1172 | ; |
@@ -1239,7 +1250,7 @@ static const struct file_operations mon_fops_binary = { | |||
1239 | .read = mon_bin_read, | 1250 | .read = mon_bin_read, |
1240 | /* .write = mon_text_write, */ | 1251 | /* .write = mon_text_write, */ |
1241 | .poll = mon_bin_poll, | 1252 | .poll = mon_bin_poll, |
1242 | .ioctl = mon_bin_ioctl, | 1253 | .unlocked_ioctl = mon_bin_unlocked_ioctl, |
1243 | #ifdef CONFIG_COMPAT | 1254 | #ifdef CONFIG_COMPAT |
1244 | .compat_ioctl = mon_bin_compat_ioctl, | 1255 | .compat_ioctl = mon_bin_compat_ioctl, |
1245 | #endif | 1256 | #endif |
diff --git a/drivers/usb/mon/mon_stat.c b/drivers/usb/mon/mon_stat.c index 1becdc3837e6..8ec94f15a738 100644 --- a/drivers/usb/mon/mon_stat.c +++ b/drivers/usb/mon/mon_stat.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
12 | #include <linux/usb.h> | 12 | #include <linux/usb.h> |
13 | #include <linux/fs.h> | 13 | #include <linux/fs.h> |
14 | #include <linux/smp_lock.h> | ||
14 | #include <asm/uaccess.h> | 15 | #include <asm/uaccess.h> |
15 | 16 | ||
16 | #include "usb_mon.h" | 17 | #include "usb_mon.h" |
@@ -63,6 +64,6 @@ const struct file_operations mon_fops_stat = { | |||
63 | .read = mon_stat_read, | 64 | .read = mon_stat_read, |
64 | /* .write = mon_stat_write, */ | 65 | /* .write = mon_stat_write, */ |
65 | /* .poll = mon_stat_poll, */ | 66 | /* .poll = mon_stat_poll, */ |
66 | /* .ioctl = mon_stat_ioctl, */ | 67 | /* .unlocked_ioctl = mon_stat_ioctl, */ |
67 | .release = mon_stat_release, | 68 | .release = mon_stat_release, |
68 | }; | 69 | }; |