aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pipe.c
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 /fs/pipe.c
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 'fs/pipe.c')
-rw-r--r--fs/pipe.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index bd3479db4b62..64a494cef0a0 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -361,7 +361,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
361 unsigned long nr_segs, loff_t pos) 361 unsigned long nr_segs, loff_t pos)
362{ 362{
363 struct file *filp = iocb->ki_filp; 363 struct file *filp = iocb->ki_filp;
364 struct inode *inode = filp->f_path.dentry->d_inode; 364 struct inode *inode = file_inode(filp);
365 struct pipe_inode_info *pipe; 365 struct pipe_inode_info *pipe;
366 int do_wakeup; 366 int do_wakeup;
367 ssize_t ret; 367 ssize_t ret;
@@ -486,7 +486,7 @@ pipe_write(struct kiocb *iocb, const struct iovec *_iov,
486 unsigned long nr_segs, loff_t ppos) 486 unsigned long nr_segs, loff_t ppos)
487{ 487{
488 struct file *filp = iocb->ki_filp; 488 struct file *filp = iocb->ki_filp;
489 struct inode *inode = filp->f_path.dentry->d_inode; 489 struct inode *inode = file_inode(filp);
490 struct pipe_inode_info *pipe; 490 struct pipe_inode_info *pipe;
491 ssize_t ret; 491 ssize_t ret;
492 int do_wakeup; 492 int do_wakeup;
@@ -677,7 +677,7 @@ bad_pipe_w(struct file *filp, const char __user *buf, size_t count,
677 677
678static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 678static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
679{ 679{
680 struct inode *inode = filp->f_path.dentry->d_inode; 680 struct inode *inode = file_inode(filp);
681 struct pipe_inode_info *pipe; 681 struct pipe_inode_info *pipe;
682 int count, buf, nrbufs; 682 int count, buf, nrbufs;
683 683
@@ -705,7 +705,7 @@ static unsigned int
705pipe_poll(struct file *filp, poll_table *wait) 705pipe_poll(struct file *filp, poll_table *wait)
706{ 706{
707 unsigned int mask; 707 unsigned int mask;
708 struct inode *inode = filp->f_path.dentry->d_inode; 708 struct inode *inode = file_inode(filp);
709 struct pipe_inode_info *pipe = inode->i_pipe; 709 struct pipe_inode_info *pipe = inode->i_pipe;
710 int nrbufs; 710 int nrbufs;
711 711
@@ -758,7 +758,7 @@ pipe_release(struct inode *inode, int decr, int decw)
758static int 758static int
759pipe_read_fasync(int fd, struct file *filp, int on) 759pipe_read_fasync(int fd, struct file *filp, int on)
760{ 760{
761 struct inode *inode = filp->f_path.dentry->d_inode; 761 struct inode *inode = file_inode(filp);
762 int retval; 762 int retval;
763 763
764 mutex_lock(&inode->i_mutex); 764 mutex_lock(&inode->i_mutex);
@@ -772,7 +772,7 @@ pipe_read_fasync(int fd, struct file *filp, int on)
772static int 772static int
773pipe_write_fasync(int fd, struct file *filp, int on) 773pipe_write_fasync(int fd, struct file *filp, int on)
774{ 774{
775 struct inode *inode = filp->f_path.dentry->d_inode; 775 struct inode *inode = file_inode(filp);
776 int retval; 776 int retval;
777 777
778 mutex_lock(&inode->i_mutex); 778 mutex_lock(&inode->i_mutex);
@@ -786,7 +786,7 @@ pipe_write_fasync(int fd, struct file *filp, int on)
786static int 786static int
787pipe_rdwr_fasync(int fd, struct file *filp, int on) 787pipe_rdwr_fasync(int fd, struct file *filp, int on)
788{ 788{
789 struct inode *inode = filp->f_path.dentry->d_inode; 789 struct inode *inode = file_inode(filp);
790 struct pipe_inode_info *pipe = inode->i_pipe; 790 struct pipe_inode_info *pipe = inode->i_pipe;
791 int retval; 791 int retval;
792 792
@@ -1037,13 +1037,13 @@ int create_pipe_files(struct file **res, int flags)
1037 1037
1038 err = -ENFILE; 1038 err = -ENFILE;
1039 f = alloc_file(&path, FMODE_WRITE, &write_pipefifo_fops); 1039 f = alloc_file(&path, FMODE_WRITE, &write_pipefifo_fops);
1040 if (!f) 1040 if (IS_ERR(f))
1041 goto err_dentry; 1041 goto err_dentry;
1042 1042
1043 f->f_flags = O_WRONLY | (flags & (O_NONBLOCK | O_DIRECT)); 1043 f->f_flags = O_WRONLY | (flags & (O_NONBLOCK | O_DIRECT));
1044 1044
1045 res[0] = alloc_file(&path, FMODE_READ, &read_pipefifo_fops); 1045 res[0] = alloc_file(&path, FMODE_READ, &read_pipefifo_fops);
1046 if (!res[0]) 1046 if (IS_ERR(res[0]))
1047 goto err_file; 1047 goto err_file;
1048 1048
1049 path_get(&path); 1049 path_get(&path);
@@ -1226,7 +1226,7 @@ int pipe_proc_fn(struct ctl_table *table, int write, void __user *buf,
1226 */ 1226 */
1227struct pipe_inode_info *get_pipe_info(struct file *file) 1227struct pipe_inode_info *get_pipe_info(struct file *file)
1228{ 1228{
1229 struct inode *i = file->f_path.dentry->d_inode; 1229 struct inode *i = file_inode(file);
1230 1230
1231 return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL; 1231 return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL;
1232} 1232}