aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/pipe.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index 81288bc2bcbb..43d79da5c57e 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -1029,20 +1029,14 @@ void free_write_pipe(struct file *f)
1029 1029
1030struct file *create_read_pipe(struct file *wrf, int flags) 1030struct file *create_read_pipe(struct file *wrf, int flags)
1031{ 1031{
1032 struct file *f = get_empty_filp(); 1032 /* Grab pipe from the writer */
1033 struct file *f = alloc_file(&wrf->f_path, FMODE_READ,
1034 &read_pipefifo_fops);
1033 if (!f) 1035 if (!f)
1034 return ERR_PTR(-ENFILE); 1036 return ERR_PTR(-ENFILE);
1035 1037
1036 /* Grab pipe from the writer */
1037 f->f_path = wrf->f_path;
1038 path_get(&wrf->f_path); 1038 path_get(&wrf->f_path);
1039 f->f_mapping = wrf->f_path.dentry->d_inode->i_mapping;
1040
1041 f->f_pos = 0;
1042 f->f_flags = O_RDONLY | (flags & O_NONBLOCK); 1039 f->f_flags = O_RDONLY | (flags & O_NONBLOCK);
1043 f->f_op = &read_pipefifo_fops;
1044 f->f_mode = FMODE_READ;
1045 f->f_version = 0;
1046 1040
1047 return f; 1041 return f;
1048} 1042}