aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/divert
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2010-03-30 01:27:50 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2010-05-16 21:06:12 -0400
commitd79b6f4de5db0103ceb4734e42ad101d836d61d9 (patch)
tree42fada62898eb8d70faff151d87c16575dbabd58 /drivers/isdn/divert
parent73296bc611cee009f3be6b451e827d1425b9c10f (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/isdn/divert')
-rw-r--r--drivers/isdn/divert/divert_procfs.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c
index 3697c409bec..724693c4d97 100644
--- a/drivers/isdn/divert/divert_procfs.c
+++ b/drivers/isdn/divert/divert_procfs.c
@@ -19,6 +19,7 @@
19#include <linux/sched.h> 19#include <linux/sched.h>
20#include <linux/isdnif.h> 20#include <linux/isdnif.h>
21#include <net/net_namespace.h> 21#include <net/net_namespace.h>
22#include <linux/smp_lock.h>
22#include "isdn_divert.h" 23#include "isdn_divert.h"
23 24
24 25
@@ -176,9 +177,7 @@ isdn_divert_close(struct inode *ino, struct file *filep)
176/*********/ 177/*********/
177/* IOCTL */ 178/* IOCTL */
178/*********/ 179/*********/
179static int 180static int isdn_divert_ioctl_unlocked(struct file *file, uint cmd, ulong arg)
180isdn_divert_ioctl(struct inode *inode, struct file *file,
181 uint cmd, ulong arg)
182{ 181{
183 divert_ioctl dioctl; 182 divert_ioctl dioctl;
184 int i; 183 int i;
@@ -257,6 +256,17 @@ isdn_divert_ioctl(struct inode *inode, struct file *file,
257 return copy_to_user((void __user *)arg, &dioctl, sizeof(dioctl)) ? -EFAULT : 0; 256 return copy_to_user((void __user *)arg, &dioctl, sizeof(dioctl)) ? -EFAULT : 0;
258} /* isdn_divert_ioctl */ 257} /* isdn_divert_ioctl */
259 258
259static long isdn_divert_ioctl(struct file *file, uint cmd, ulong arg)
260{
261 long ret;
262
263 lock_kernel();
264 ret = isdn_divert_ioctl_unlocked(file, cmd, arg);
265 unlock_kernel();
266
267 return ret;
268}
269
260static const struct file_operations isdn_fops = 270static const struct file_operations isdn_fops =
261{ 271{
262 .owner = THIS_MODULE, 272 .owner = THIS_MODULE,
@@ -264,7 +274,7 @@ static const struct file_operations isdn_fops =
264 .read = isdn_divert_read, 274 .read = isdn_divert_read,
265 .write = isdn_divert_write, 275 .write = isdn_divert_write,
266 .poll = isdn_divert_poll, 276 .poll = isdn_divert_poll,
267 .ioctl = isdn_divert_ioctl, 277 .unlocked_ioctl = isdn_divert_ioctl,
268 .open = isdn_divert_open, 278 .open = isdn_divert_open,
269 .release = isdn_divert_close, 279 .release = isdn_divert_close,
270}; 280};