Skip to content

Commit 9918ff2

Browse files
committed
sunrpc: Pushdown the bkl from sunrpc cache ioctl
Pushdown the bkl to cache_ioctl_pipefs. Signed-off-by: Frederic Weisbecker <[email protected]> Cc: "J. Bruce Fields" <[email protected]> Cc: Neil Brown <[email protected]> Cc: Nfs <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: John Kacur <[email protected]> Cc: Arnd Bergmann <[email protected]>
1 parent 674b604 commit 9918ff2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

net/sunrpc/cache.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <linux/sunrpc/cache.h>
3434
#include <linux/sunrpc/stats.h>
3535
#include <linux/sunrpc/rpc_pipe_fs.h>
36+
#include <linux/smp_lock.h>
3637

3738
#define RPCDBG_FACILITY RPCDBG_CACHE
3839

@@ -1525,12 +1526,18 @@ static unsigned int cache_poll_pipefs(struct file *filp, poll_table *wait)
15251526
return cache_poll(filp, wait, cd);
15261527
}
15271528

1528-
static int cache_ioctl_pipefs(struct inode *inode, struct file *filp,
1529+
static long cache_ioctl_pipefs(struct file *filp,
15291530
unsigned int cmd, unsigned long arg)
15301531
{
1532+
struct inode *inode = filp->f_dentry->d_inode;
15311533
struct cache_detail *cd = RPC_I(inode)->private;
1534+
long ret;
15321535

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;
15341541
}
15351542

15361543
static int cache_open_pipefs(struct inode *inode, struct file *filp)
@@ -1553,7 +1560,7 @@ const struct file_operations cache_file_operations_pipefs = {
15531560
.read = cache_read_pipefs,
15541561
.write = cache_write_pipefs,
15551562
.poll = cache_poll_pipefs,
1556-
.ioctl = cache_ioctl_pipefs, /* for FIONREAD */
1563+
.unlocked_ioctl = cache_ioctl_pipefs, /* for FIONREAD */
15571564
.open = cache_open_pipefs,
15581565
.release = cache_release_pipefs,
15591566
};

0 commit comments

Comments
 (0)