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
@@ -1525,12 +1526,18 @@ static unsigned int cache_poll_pipefs(struct file *filp, poll_table *wait)
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 @@ const struct file_operations cache_file_operations_pipefs = {
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
};
0 commit comments