aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 23:16:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 23:16:07 -0500
commitd895cb1af15c04c522a25c79cc429076987c089b (patch)
tree895dc9157e28f603d937a58be664e4e440d5530c /net
parent9626357371b519f2b955fef399647181034a77fe (diff)
parentd3d009cb965eae7e002ea5badf603ea8f4c34915 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile (part one) from Al Viro: "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent locking violations, etc. The most visible changes here are death of FS_REVAL_DOT (replaced with "has ->d_weak_revalidate()") and a new helper getting from struct file to inode. Some bits of preparation to xattr method interface changes. Misc patches by various people sent this cycle *and* ocfs2 fixes from several cycles ago that should've been upstream right then. PS: the next vfs pile will be xattr stuff." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits) saner proc_get_inode() calling conventions proc: avoid extra pde_put() in proc_fill_super() fs: change return values from -EACCES to -EPERM fs/exec.c: make bprm_mm_init() static ocfs2/dlm: use GFP_ATOMIC inside a spin_lock ocfs2: fix possible use-after-free with AIO ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero target: writev() on single-element vector is pointless export kernel_write(), convert open-coded instances fs: encode_fh: return FILEID_INVALID if invalid fid_type kill f_vfsmnt vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op nfsd: handle vfs_getattr errors in acl protocol switch vfs_getattr() to struct path default SET_PERSONALITY() in linux/elf.h ceph: prepopulate inodes only when request is aborted d_hash_and_lookup(): export, switch open-coded instances 9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate() 9p: split dropping the acls from v9fs_set_create_acl() ...
Diffstat (limited to 'net')
-rw-r--r--net/atm/proc.c2
-rw-r--r--net/core/net_namespace.c2
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c2
-rw-r--r--net/netfilter/xt_recent.c2
-rw-r--r--net/netlink/af_netlink.c2
-rw-r--r--net/socket.c5
-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
-rw-r--r--net/unix/garbage.c2
10 files changed, 28 insertions, 29 deletions
diff --git a/net/atm/proc.c b/net/atm/proc.c
index b4e75340b162..6ac35ff0d6b9 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)
657static ssize_t clusterip_proc_write(struct file *file, const char __user *input, 657static 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 31bf233dae97..d9cad315229d 100644
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -540,7 +540,7 @@ static ssize_t
540recent_mt_proc_write(struct file *file, const char __user *input, 540recent_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 3d55e0c713e2..8097b4f3ead4 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
810struct sock *netlink_getsockbyfilp(struct file *filp) 810struct 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/socket.c b/net/socket.c
index ee0d029e5130..88f759adf3af 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -369,16 +369,15 @@ struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname)
369 369
370 file = alloc_file(&path, FMODE_READ | FMODE_WRITE, 370 file = alloc_file(&path, FMODE_READ | FMODE_WRITE,
371 &socket_file_ops); 371 &socket_file_ops);
372 if (unlikely(!file)) { 372 if (unlikely(IS_ERR(file))) {
373 /* drop dentry, keep inode */ 373 /* drop dentry, keep inode */
374 ihold(path.dentry->d_inode); 374 ihold(path.dentry->d_inode);
375 path_put(&path); 375 path_put(&path);
376 return ERR_PTR(-ENFILE); 376 return file;
377 } 377 }
378 378
379 sock->file = file; 379 sock->file = file;
380 file->f_flags = O_RDWR | (flags & O_NONBLOCK); 380 file->f_flags = O_RDWR | (flags & O_NONBLOCK);
381 file->f_pos = 0;
382 file->private_data = sock; 381 file->private_data = sock;
383 return file; 382 return file;
384} 383}
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 6ea29f4ed6c0..5257d2982ba5 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -620,7 +620,7 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
620 const void *p, *end; 620 const void *p, *end;
621 void *buf; 621 void *buf;
622 struct gss_upcall_msg *gss_msg; 622 struct gss_upcall_msg *gss_msg;
623 struct rpc_pipe *pipe = RPC_I(filp->f_dentry->d_inode)->pipe; 623 struct rpc_pipe *pipe = RPC_I(file_inode(filp))->pipe;
624 struct gss_cl_ctx *ctx; 624 struct gss_cl_ctx *ctx;
625 uid_t id; 625 uid_t id;
626 kuid_t uid; 626 kuid_t uid;
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)
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;
99struct sock *unix_get_socket(struct file *filp) 99struct 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 ?