diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-01-23 17:07:38 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-22 23:31:31 -0500 |
commit | 496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch) | |
tree | 8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /net | |
parent | 57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff) |
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net')
-rw-r--r-- | net/atm/proc.c | 2 | ||||
-rw-r--r-- | net/core/net_namespace.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_CLUSTERIP.c | 2 | ||||
-rw-r--r-- | net/netfilter/xt_recent.c | 2 | ||||
-rw-r--r-- | net/netlink/af_netlink.c | 2 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 2 | ||||
-rw-r--r-- | net/sunrpc/cache.c | 28 | ||||
-rw-r--r-- | net/sunrpc/rpc_pipe.c | 10 | ||||
-rw-r--r-- | net/unix/garbage.c | 2 |
9 files changed, 26 insertions, 26 deletions
diff --git a/net/atm/proc.c b/net/atm/proc.c index 0d020de8d233..2518b5f8bb8a 100644 --- a/net/atm/proc.c +++ b/net/atm/proc.c | |||
@@ -385,7 +385,7 @@ static ssize_t proc_dev_atm_read(struct file *file, char __user *buf, | |||
385 | page = get_zeroed_page(GFP_KERNEL); | 385 | page = get_zeroed_page(GFP_KERNEL); |
386 | if (!page) | 386 | if (!page) |
387 | return -ENOMEM; | 387 | return -ENOMEM; |
388 | dev = PDE(file->f_path.dentry->d_inode)->data; | 388 | dev = PDE(file_inode(file))->data; |
389 | if (!dev->ops->proc_read) | 389 | if (!dev->ops->proc_read) |
390 | length = -EINVAL; | 390 | length = -EINVAL; |
391 | else { | 391 | else { |
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 8acce01b6dab..80e271d9e64b 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
@@ -344,7 +344,7 @@ struct net *get_net_ns_by_fd(int fd) | |||
344 | if (IS_ERR(file)) | 344 | if (IS_ERR(file)) |
345 | return ERR_CAST(file); | 345 | return ERR_CAST(file); |
346 | 346 | ||
347 | ei = PROC_I(file->f_dentry->d_inode); | 347 | ei = PROC_I(file_inode(file)); |
348 | if (ei->ns_ops == &netns_operations) | 348 | if (ei->ns_ops == &netns_operations) |
349 | net = get_net(ei->ns); | 349 | net = get_net(ei->ns); |
350 | else | 350 | else |
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index 75e33a7048f8..5852b249054f 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c | |||
@@ -657,7 +657,7 @@ static int clusterip_proc_release(struct inode *inode, struct file *file) | |||
657 | static ssize_t clusterip_proc_write(struct file *file, const char __user *input, | 657 | static ssize_t clusterip_proc_write(struct file *file, const char __user *input, |
658 | size_t size, loff_t *ofs) | 658 | size_t size, loff_t *ofs) |
659 | { | 659 | { |
660 | struct clusterip_config *c = PDE(file->f_path.dentry->d_inode)->data; | 660 | struct clusterip_config *c = PDE(file_inode(file))->data; |
661 | #define PROC_WRITELEN 10 | 661 | #define PROC_WRITELEN 10 |
662 | char buffer[PROC_WRITELEN+1]; | 662 | char buffer[PROC_WRITELEN+1]; |
663 | unsigned long nodenum; | 663 | unsigned long nodenum; |
diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c index 978efc9b555a..c3cdcb47c149 100644 --- a/net/netfilter/xt_recent.c +++ b/net/netfilter/xt_recent.c | |||
@@ -540,7 +540,7 @@ static ssize_t | |||
540 | recent_mt_proc_write(struct file *file, const char __user *input, | 540 | recent_mt_proc_write(struct file *file, const char __user *input, |
541 | size_t size, loff_t *loff) | 541 | size_t size, loff_t *loff) |
542 | { | 542 | { |
543 | const struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | 543 | const struct proc_dir_entry *pde = PDE(file_inode(file)); |
544 | struct recent_table *t = pde->data; | 544 | struct recent_table *t = pde->data; |
545 | struct recent_entry *e; | 545 | struct recent_entry *e; |
546 | char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")]; | 546 | char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")]; |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index c0353d55d56f..c1ee3a8cf111 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -809,7 +809,7 @@ static struct sock *netlink_getsockbyportid(struct sock *ssk, u32 portid) | |||
809 | 809 | ||
810 | struct sock *netlink_getsockbyfilp(struct file *filp) | 810 | struct sock *netlink_getsockbyfilp(struct file *filp) |
811 | { | 811 | { |
812 | struct inode *inode = filp->f_path.dentry->d_inode; | 812 | struct inode *inode = file_inode(filp); |
813 | struct sock *sock; | 813 | struct sock *sock; |
814 | 814 | ||
815 | if (!S_ISSOCK(inode->i_mode)) | 815 | if (!S_ISSOCK(inode->i_mode)) |
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, | |||
1454 | static ssize_t cache_read_procfs(struct file *filp, char __user *buf, | 1454 | static 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, | |||
1462 | static ssize_t cache_write_procfs(struct file *filp, const char __user *buf, | 1462 | static 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 | ||
1470 | static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait) | 1470 | static 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) | |||
1477 | static long cache_ioctl_procfs(struct file *filp, | 1477 | static 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) | |||
1546 | static ssize_t read_flush_procfs(struct file *filp, char __user *buf, | 1546 | static 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); | |||
1686 | static ssize_t cache_read_pipefs(struct file *filp, char __user *buf, | 1686 | static 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, | |||
1694 | static ssize_t cache_write_pipefs(struct file *filp, const char __user *buf, | 1694 | static 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 | ||
1702 | static unsigned int cache_poll_pipefs(struct file *filp, poll_table *wait) | 1702 | static 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) | |||
1709 | static long cache_ioctl_pipefs(struct file *filp, | 1709 | static 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) | |||
1778 | static ssize_t read_flush_pipefs(struct file *filp, char __user *buf, | 1778 | static 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: | |||
284 | static ssize_t | 284 | static ssize_t |
285 | rpc_pipe_read(struct file *filp, char __user *buf, size_t len, loff_t *offset) | 285 | rpc_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: | |||
328 | static ssize_t | 328 | static ssize_t |
329 | rpc_pipe_write(struct file *filp, const char __user *buf, size_t len, loff_t *offset) | 329 | rpc_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 | |||
342 | static unsigned int | 342 | static unsigned int |
343 | rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait) | 343 | rpc_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) | |||
360 | static long | 360 | static long |
361 | rpc_pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 361 | rpc_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 | */ |
835 | struct dentry *rpc_mkpipe_dentry(struct dentry *parent, const char *name, | 835 | struct dentry *rpc_mkpipe_dentry(struct dentry *parent, const char *name, |
836 | void *private, struct rpc_pipe *pipe) | 836 | void *private, struct rpc_pipe *pipe) |
diff --git a/net/unix/garbage.c b/net/unix/garbage.c index b6f4b994eb35..d0f6545b0010 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c | |||
@@ -99,7 +99,7 @@ unsigned int unix_tot_inflight; | |||
99 | struct sock *unix_get_socket(struct file *filp) | 99 | struct sock *unix_get_socket(struct file *filp) |
100 | { | 100 | { |
101 | struct sock *u_sock = NULL; | 101 | struct sock *u_sock = NULL; |
102 | struct inode *inode = filp->f_path.dentry->d_inode; | 102 | struct inode *inode = file_inode(filp); |
103 | 103 | ||
104 | /* | 104 | /* |
105 | * Socket ? | 105 | * Socket ? |