Commit 9918ff26b301e9a57f25fb12b44a46ad0c1e8f8f
1 parent
674b604cdd
Exists in
master
and in
7 other branches
sunrpc: Pushdown the bkl from sunrpc cache ioctl
Pushdown the bkl to cache_ioctl_pipefs. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Neil Brown <neilb@suse.de> Cc: Nfs <linux-nfs@vger.kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: John Kacur <jkacur@redhat.com> Cc: Arnd Bergmann <arnd@arndb.de>
Showing 1 changed file with 10 additions and 3 deletions Side-by-side Diff
net/sunrpc/cache.c
... | ... | @@ -33,6 +33,7 @@ |
33 | 33 | #include <linux/sunrpc/cache.h> |
34 | 34 | #include <linux/sunrpc/stats.h> |
35 | 35 | #include <linux/sunrpc/rpc_pipe_fs.h> |
36 | +#include <linux/smp_lock.h> | |
36 | 37 | |
37 | 38 | #define RPCDBG_FACILITY RPCDBG_CACHE |
38 | 39 | |
39 | 40 | |
40 | 41 | |
41 | 42 | |
... | ... | @@ -1525,12 +1526,18 @@ |
1525 | 1526 | return cache_poll(filp, wait, cd); |
1526 | 1527 | } |
1527 | 1528 | |
1528 | -static int cache_ioctl_pipefs(struct inode *inode, struct file *filp, | |
1529 | +static long cache_ioctl_pipefs(struct file *filp, | |
1529 | 1530 | unsigned int cmd, unsigned long arg) |
1530 | 1531 | { |
1532 | + struct inode *inode = filp->f_dentry->d_inode; | |
1531 | 1533 | struct cache_detail *cd = RPC_I(inode)->private; |
1534 | + long ret; | |
1532 | 1535 | |
1533 | - return cache_ioctl(inode, filp, cmd, arg, cd); | |
1536 | + lock_kernel(); | |
1537 | + ret = cache_ioctl(inode, filp, cmd, arg, cd); | |
1538 | + unlock_kernel(); | |
1539 | + | |
1540 | + return ret; | |
1534 | 1541 | } |
1535 | 1542 | |
1536 | 1543 | static int cache_open_pipefs(struct inode *inode, struct file *filp) |
... | ... | @@ -1553,7 +1560,7 @@ |
1553 | 1560 | .read = cache_read_pipefs, |
1554 | 1561 | .write = cache_write_pipefs, |
1555 | 1562 | .poll = cache_poll_pipefs, |
1556 | - .ioctl = cache_ioctl_pipefs, /* for FIONREAD */ | |
1563 | + .unlocked_ioctl = cache_ioctl_pipefs, /* for FIONREAD */ | |
1557 | 1564 | .open = cache_open_pipefs, |
1558 | 1565 | .release = cache_release_pipefs, |
1559 | 1566 | }; |