aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/cache.c
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 /net/sunrpc/cache.c
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 'net/sunrpc/cache.c')
-rw-r--r--net/sunrpc/cache.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 39bddba53ba1..95690a8a4d80 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -1331,12 +1331,18 @@ static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait)
1331 return cache_poll(filp, wait, cd); 1331 return cache_poll(filp, wait, cd);
1332} 1332}
1333 1333
1334static int cache_ioctl_procfs(struct inode *inode, struct file *filp, 1334static long cache_ioctl_procfs(struct file *filp,
1335 unsigned int cmd, unsigned long arg) 1335 unsigned int cmd, unsigned long arg)
1336{ 1336{
1337 long ret;
1338 struct inode *inode = filp->f_path.dentry->d_inode;
1337 struct cache_detail *cd = PDE(inode)->data; 1339 struct cache_detail *cd = PDE(inode)->data;
1338 1340
1339 return cache_ioctl(inode, filp, cmd, arg, cd); 1341 lock_kernel();
1342 ret = cache_ioctl(inode, filp, cmd, arg, cd);
1343 unlock_kernel();
1344
1345 return ret;
1340} 1346}
1341 1347
1342static int cache_open_procfs(struct inode *inode, struct file *filp) 1348static int cache_open_procfs(struct inode *inode, struct file *filp)
@@ -1359,7 +1365,7 @@ static const struct file_operations cache_file_operations_procfs = {
1359 .read = cache_read_procfs, 1365 .read = cache_read_procfs,
1360 .write = cache_write_procfs, 1366 .write = cache_write_procfs,
1361 .poll = cache_poll_procfs, 1367 .poll = cache_poll_procfs,
1362 .ioctl = cache_ioctl_procfs, /* for FIONREAD */ 1368 .unlocked_ioctl = cache_ioctl_procfs, /* for FIONREAD */
1363 .open = cache_open_procfs, 1369 .open = cache_open_procfs,
1364 .release = cache_release_procfs, 1370 .release = cache_release_procfs,
1365}; 1371};