diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-03-30 01:27:50 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-05-16 21:06:12 -0400 |
commit | d79b6f4de5db0103ceb4734e42ad101d836d61d9 (patch) | |
tree | 42fada62898eb8d70faff151d87c16575dbabd58 /drivers/char/i8k.c | |
parent | 73296bc611cee009f3be6b451e827d1425b9c10f (diff) |
procfs: Push down the bkl from ioctl
Push down the bkl from procfs's ioctl main handler to its users.
Only three procfs users implement an ioctl (non unlocked) handler.
Turn them into unlocked_ioctl and push down the Devil inside.
v2: PDE(inode)->data doesn't need to be under bkl
v3: And don't forget to git-add the result
v4: Use wrappers to pushdown instead of an invasive and error prone
handlers surgery.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: John Kacur <jkacur@redhat.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Diffstat (limited to 'drivers/char/i8k.c')
-rw-r--r-- | drivers/char/i8k.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index fc8cf7ac7f2b..4cd8b227c11f 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/seq_file.h> | 23 | #include <linux/seq_file.h> |
24 | #include <linux/dmi.h> | 24 | #include <linux/dmi.h> |
25 | #include <linux/capability.h> | 25 | #include <linux/capability.h> |
26 | #include <linux/smp_lock.h> | ||
26 | #include <asm/uaccess.h> | 27 | #include <asm/uaccess.h> |
27 | #include <asm/io.h> | 28 | #include <asm/io.h> |
28 | 29 | ||
@@ -82,8 +83,7 @@ module_param(fan_mult, int, 0); | |||
82 | MODULE_PARM_DESC(fan_mult, "Factor to multiply fan speed with"); | 83 | MODULE_PARM_DESC(fan_mult, "Factor to multiply fan speed with"); |
83 | 84 | ||
84 | static int i8k_open_fs(struct inode *inode, struct file *file); | 85 | static int i8k_open_fs(struct inode *inode, struct file *file); |
85 | static int i8k_ioctl(struct inode *, struct file *, unsigned int, | 86 | static long i8k_ioctl(struct file *, unsigned int, unsigned long); |
86 | unsigned long); | ||
87 | 87 | ||
88 | static const struct file_operations i8k_fops = { | 88 | static const struct file_operations i8k_fops = { |
89 | .owner = THIS_MODULE, | 89 | .owner = THIS_MODULE, |
@@ -91,7 +91,7 @@ static const struct file_operations i8k_fops = { | |||
91 | .read = seq_read, | 91 | .read = seq_read, |
92 | .llseek = seq_lseek, | 92 | .llseek = seq_lseek, |
93 | .release = single_release, | 93 | .release = single_release, |
94 | .ioctl = i8k_ioctl, | 94 | .unlocked_ioctl = i8k_ioctl, |
95 | }; | 95 | }; |
96 | 96 | ||
97 | struct smm_regs { | 97 | struct smm_regs { |
@@ -307,8 +307,8 @@ static int i8k_get_dell_signature(int req_fn) | |||
307 | return regs.eax == 1145651527 && regs.edx == 1145392204 ? 0 : -1; | 307 | return regs.eax == 1145651527 && regs.edx == 1145392204 ? 0 : -1; |
308 | } | 308 | } |
309 | 309 | ||
310 | static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, | 310 | static int |
311 | unsigned long arg) | 311 | i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg) |
312 | { | 312 | { |
313 | int val = 0; | 313 | int val = 0; |
314 | int speed; | 314 | int speed; |
@@ -395,6 +395,17 @@ static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, | |||
395 | return 0; | 395 | return 0; |
396 | } | 396 | } |
397 | 397 | ||
398 | static long i8k_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) | ||
399 | { | ||
400 | long ret; | ||
401 | |||
402 | lock_kernel(); | ||
403 | ret = i8k_ioctl_unlocked(fp, cmd, arg); | ||
404 | unlock_kernel(); | ||
405 | |||
406 | return ret; | ||
407 | } | ||
408 | |||
398 | /* | 409 | /* |
399 | * Print the information for /proc/i8k. | 410 | * Print the information for /proc/i8k. |
400 | */ | 411 | */ |