Merge branch 'for-2.6.35' of git://linux-nfs.org/~bfields/linux
[pandora-kernel.git] / net / sunrpc / cache.c
index a3f340c..c2173eb 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/workqueue.h>
 #include <linux/mutex.h>
 #include <linux/pagemap.h>
+#include <linux/smp_lock.h>
 #include <asm/ioctls.h>
 #include <linux/sunrpc/types.h>
 #include <linux/sunrpc/cache.h>
@@ -1344,12 +1345,18 @@ static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait)
        return cache_poll(filp, wait, cd);
 }
 
-static int cache_ioctl_procfs(struct inode *inode, struct file *filp,
-                             unsigned int cmd, unsigned long arg)
+static long cache_ioctl_procfs(struct file *filp,
+                              unsigned int cmd, unsigned long arg)
 {
+       long ret;
+       struct inode *inode = filp->f_path.dentry->d_inode;
        struct cache_detail *cd = PDE(inode)->data;
 
-       return cache_ioctl(inode, filp, cmd, arg, cd);
+       lock_kernel();
+       ret = cache_ioctl(inode, filp, cmd, arg, cd);
+       unlock_kernel();
+
+       return ret;
 }
 
 static int cache_open_procfs(struct inode *inode, struct file *filp)
@@ -1372,7 +1379,7 @@ static const struct file_operations cache_file_operations_procfs = {
        .read           = cache_read_procfs,
        .write          = cache_write_procfs,
        .poll           = cache_poll_procfs,
-       .ioctl          = cache_ioctl_procfs, /* for FIONREAD */
+       .unlocked_ioctl = cache_ioctl_procfs, /* for FIONREAD */
        .open           = cache_open_procfs,
        .release        = cache_release_procfs,
 };