aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-23 17:07:38 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-22 23:31:31 -0500
commit496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch)
tree8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /net/sunrpc
parent57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff)
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c2
-rw-r--r--net/sunrpc/cache.c28
-rw-r--r--net/sunrpc/rpc_pipe.c10
3 files changed, 20 insertions, 20 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 6e5c824b040b..294b4bf7ec6e 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -616,7 +616,7 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
616 const void *p, *end; 616 const void *p, *end;
617 void *buf; 617 void *buf;
618 struct gss_upcall_msg *gss_msg; 618 struct gss_upcall_msg *gss_msg;
619 struct rpc_pipe *pipe = RPC_I(filp->f_dentry->d_inode)->pipe; 619 struct rpc_pipe *pipe = RPC_I(file_inode(filp))->pipe;
620 struct gss_cl_ctx *ctx; 620 struct gss_cl_ctx *ctx;
621 uid_t uid; 621 uid_t uid;
622 ssize_t err = -EFBIG; 622 ssize_t err = -EFBIG;
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 9afa4393c217..f3897d10f649 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -755,7 +755,7 @@ static ssize_t cache_read(struct file *filp, char __user *buf, size_t count,
755{ 755{
756 struct cache_reader *rp = filp->private_data; 756 struct cache_reader *rp = filp->private_data;
757 struct cache_request *rq; 757 struct cache_request *rq;
758 struct inode *inode = filp->f_path.dentry->d_inode; 758 struct inode *inode = file_inode(filp);
759 int err; 759 int err;
760 760
761 if (count == 0) 761 if (count == 0)
@@ -886,7 +886,7 @@ static ssize_t cache_write(struct file *filp, const char __user *buf,
886 struct cache_detail *cd) 886 struct cache_detail *cd)
887{ 887{
888 struct address_space *mapping = filp->f_mapping; 888 struct address_space *mapping = filp->f_mapping;
889 struct inode *inode = filp->f_path.dentry->d_inode; 889 struct inode *inode = file_inode(filp);
890 ssize_t ret = -EINVAL; 890 ssize_t ret = -EINVAL;
891 891
892 if (!cd->cache_parse) 892 if (!cd->cache_parse)
@@ -1454,7 +1454,7 @@ static ssize_t write_flush(struct file *file, const char __user *buf,
1454static ssize_t cache_read_procfs(struct file *filp, char __user *buf, 1454static ssize_t cache_read_procfs(struct file *filp, char __user *buf,
1455 size_t count, loff_t *ppos) 1455 size_t count, loff_t *ppos)
1456{ 1456{
1457 struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1457 struct cache_detail *cd = PDE(file_inode(filp))->data;
1458 1458
1459 return cache_read(filp, buf, count, ppos, cd); 1459 return cache_read(filp, buf, count, ppos, cd);
1460} 1460}
@@ -1462,14 +1462,14 @@ static ssize_t cache_read_procfs(struct file *filp, char __user *buf,
1462static ssize_t cache_write_procfs(struct file *filp, const char __user *buf, 1462static ssize_t cache_write_procfs(struct file *filp, const char __user *buf,
1463 size_t count, loff_t *ppos) 1463 size_t count, loff_t *ppos)
1464{ 1464{
1465 struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1465 struct cache_detail *cd = PDE(file_inode(filp))->data;
1466 1466
1467 return cache_write(filp, buf, count, ppos, cd); 1467 return cache_write(filp, buf, count, ppos, cd);
1468} 1468}
1469 1469
1470static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait) 1470static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait)
1471{ 1471{
1472 struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1472 struct cache_detail *cd = PDE(file_inode(filp))->data;
1473 1473
1474 return cache_poll(filp, wait, cd); 1474 return cache_poll(filp, wait, cd);
1475} 1475}
@@ -1477,7 +1477,7 @@ static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait)
1477static long cache_ioctl_procfs(struct file *filp, 1477static long cache_ioctl_procfs(struct file *filp,
1478 unsigned int cmd, unsigned long arg) 1478 unsigned int cmd, unsigned long arg)
1479{ 1479{
1480 struct inode *inode = filp->f_path.dentry->d_inode; 1480 struct inode *inode = file_inode(filp);
1481 struct cache_detail *cd = PDE(inode)->data; 1481 struct cache_detail *cd = PDE(inode)->data;
1482 1482
1483 return cache_ioctl(inode, filp, cmd, arg, cd); 1483 return cache_ioctl(inode, filp, cmd, arg, cd);
@@ -1546,7 +1546,7 @@ static int release_flush_procfs(struct inode *inode, struct file *filp)
1546static ssize_t read_flush_procfs(struct file *filp, char __user *buf, 1546static ssize_t read_flush_procfs(struct file *filp, char __user *buf,
1547 size_t count, loff_t *ppos) 1547 size_t count, loff_t *ppos)
1548{ 1548{
1549 struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1549 struct cache_detail *cd = PDE(file_inode(filp))->data;
1550 1550
1551 return read_flush(filp, buf, count, ppos, cd); 1551 return read_flush(filp, buf, count, ppos, cd);
1552} 1552}
@@ -1555,7 +1555,7 @@ static ssize_t write_flush_procfs(struct file *filp,
1555 const char __user *buf, 1555 const char __user *buf,
1556 size_t count, loff_t *ppos) 1556 size_t count, loff_t *ppos)
1557{ 1557{
1558 struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1558 struct cache_detail *cd = PDE(file_inode(filp))->data;
1559 1559
1560 return write_flush(filp, buf, count, ppos, cd); 1560 return write_flush(filp, buf, count, ppos, cd);
1561} 1561}
@@ -1686,7 +1686,7 @@ EXPORT_SYMBOL_GPL(cache_destroy_net);
1686static ssize_t cache_read_pipefs(struct file *filp, char __user *buf, 1686static ssize_t cache_read_pipefs(struct file *filp, char __user *buf,
1687 size_t count, loff_t *ppos) 1687 size_t count, loff_t *ppos)
1688{ 1688{
1689 struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1689 struct cache_detail *cd = RPC_I(file_inode(filp))->private;
1690 1690
1691 return cache_read(filp, buf, count, ppos, cd); 1691 return cache_read(filp, buf, count, ppos, cd);
1692} 1692}
@@ -1694,14 +1694,14 @@ static ssize_t cache_read_pipefs(struct file *filp, char __user *buf,
1694static ssize_t cache_write_pipefs(struct file *filp, const char __user *buf, 1694static ssize_t cache_write_pipefs(struct file *filp, const char __user *buf,
1695 size_t count, loff_t *ppos) 1695 size_t count, loff_t *ppos)
1696{ 1696{
1697 struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1697 struct cache_detail *cd = RPC_I(file_inode(filp))->private;
1698 1698
1699 return cache_write(filp, buf, count, ppos, cd); 1699 return cache_write(filp, buf, count, ppos, cd);
1700} 1700}
1701 1701
1702static unsigned int cache_poll_pipefs(struct file *filp, poll_table *wait) 1702static unsigned int cache_poll_pipefs(struct file *filp, poll_table *wait)
1703{ 1703{
1704 struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1704 struct cache_detail *cd = RPC_I(file_inode(filp))->private;
1705 1705
1706 return cache_poll(filp, wait, cd); 1706 return cache_poll(filp, wait, cd);
1707} 1707}
@@ -1709,7 +1709,7 @@ static unsigned int cache_poll_pipefs(struct file *filp, poll_table *wait)
1709static long cache_ioctl_pipefs(struct file *filp, 1709static long cache_ioctl_pipefs(struct file *filp,
1710 unsigned int cmd, unsigned long arg) 1710 unsigned int cmd, unsigned long arg)
1711{ 1711{
1712 struct inode *inode = filp->f_dentry->d_inode; 1712 struct inode *inode = file_inode(filp);
1713 struct cache_detail *cd = RPC_I(inode)->private; 1713 struct cache_detail *cd = RPC_I(inode)->private;
1714 1714
1715 return cache_ioctl(inode, filp, cmd, arg, cd); 1715 return cache_ioctl(inode, filp, cmd, arg, cd);
@@ -1778,7 +1778,7 @@ static int release_flush_pipefs(struct inode *inode, struct file *filp)
1778static ssize_t read_flush_pipefs(struct file *filp, char __user *buf, 1778static ssize_t read_flush_pipefs(struct file *filp, char __user *buf,
1779 size_t count, loff_t *ppos) 1779 size_t count, loff_t *ppos)
1780{ 1780{
1781 struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1781 struct cache_detail *cd = RPC_I(file_inode(filp))->private;
1782 1782
1783 return read_flush(filp, buf, count, ppos, cd); 1783 return read_flush(filp, buf, count, ppos, cd);
1784} 1784}
@@ -1787,7 +1787,7 @@ static ssize_t write_flush_pipefs(struct file *filp,
1787 const char __user *buf, 1787 const char __user *buf,
1788 size_t count, loff_t *ppos) 1788 size_t count, loff_t *ppos)
1789{ 1789{
1790 struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1790 struct cache_detail *cd = RPC_I(file_inode(filp))->private;
1791 1791
1792 return write_flush(filp, buf, count, ppos, cd); 1792 return write_flush(filp, buf, count, ppos, cd);
1793} 1793}
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index fd10981ea792..7b9b40224a27 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -284,7 +284,7 @@ out:
284static ssize_t 284static ssize_t
285rpc_pipe_read(struct file *filp, char __user *buf, size_t len, loff_t *offset) 285rpc_pipe_read(struct file *filp, char __user *buf, size_t len, loff_t *offset)
286{ 286{
287 struct inode *inode = filp->f_path.dentry->d_inode; 287 struct inode *inode = file_inode(filp);
288 struct rpc_pipe *pipe; 288 struct rpc_pipe *pipe;
289 struct rpc_pipe_msg *msg; 289 struct rpc_pipe_msg *msg;
290 int res = 0; 290 int res = 0;
@@ -328,7 +328,7 @@ out_unlock:
328static ssize_t 328static ssize_t
329rpc_pipe_write(struct file *filp, const char __user *buf, size_t len, loff_t *offset) 329rpc_pipe_write(struct file *filp, const char __user *buf, size_t len, loff_t *offset)
330{ 330{
331 struct inode *inode = filp->f_path.dentry->d_inode; 331 struct inode *inode = file_inode(filp);
332 int res; 332 int res;
333 333
334 mutex_lock(&inode->i_mutex); 334 mutex_lock(&inode->i_mutex);
@@ -342,7 +342,7 @@ rpc_pipe_write(struct file *filp, const char __user *buf, size_t len, loff_t *of
342static unsigned int 342static unsigned int
343rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait) 343rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait)
344{ 344{
345 struct inode *inode = filp->f_path.dentry->d_inode; 345 struct inode *inode = file_inode(filp);
346 struct rpc_inode *rpci = RPC_I(inode); 346 struct rpc_inode *rpci = RPC_I(inode);
347 unsigned int mask = POLLOUT | POLLWRNORM; 347 unsigned int mask = POLLOUT | POLLWRNORM;
348 348
@@ -360,7 +360,7 @@ rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait)
360static long 360static long
361rpc_pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 361rpc_pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
362{ 362{
363 struct inode *inode = filp->f_path.dentry->d_inode; 363 struct inode *inode = file_inode(filp);
364 struct rpc_pipe *pipe; 364 struct rpc_pipe *pipe;
365 int len; 365 int len;
366 366
@@ -830,7 +830,7 @@ static int rpc_rmdir_depopulate(struct dentry *dentry,
830 * responses to upcalls. They will result in calls to @msg->downcall. 830 * responses to upcalls. They will result in calls to @msg->downcall.
831 * 831 *
832 * The @private argument passed here will be available to all these methods 832 * The @private argument passed here will be available to all these methods
833 * from the file pointer, via RPC_I(file->f_dentry->d_inode)->private. 833 * from the file pointer, via RPC_I(file_inode(file))->private.
834 */ 834 */
835struct dentry *rpc_mkpipe_dentry(struct dentry *parent, const char *name, 835struct dentry *rpc_mkpipe_dentry(struct dentry *parent, const char *name,
836 void *private, struct rpc_pipe *pipe) 836 void *private, struct rpc_pipe *pipe)