summaryrefslogtreecommitdiffstats
path: root/fs/pipe.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-08-09 01:01:37 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-12-16 12:16:43 -0500
commitd231412db66355e72d606f8403ee8b6bd8ad4f9a (patch)
treed27282bbe879c2b0d0977594990c8e0701509df1 /fs/pipe.c
parent2c48b9c45579a9b5e3e74694eebf3d2451f3dbd3 (diff)
downloadlinux-d231412db66355e72d606f8403ee8b6bd8ad4f9a.tar.gz
linux-d231412db66355e72d606f8403ee8b6bd8ad4f9a.tar.bz2
linux-d231412db66355e72d606f8403ee8b6bd8ad4f9a.zip
switch create_read_pipe() to alloc_file()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/pipe.c')
-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)
struct file *create_read_pipe(struct file *wrf, int flags)
{
- struct file *f = get_empty_filp();
+ /* Grab pipe from the writer */
+ struct file *f = alloc_file(&wrf->f_path, FMODE_READ,
+ &read_pipefifo_fops);
if (!f)
return ERR_PTR(-ENFILE);
- /* Grab pipe from the writer */
- f->f_path = wrf->f_path;
path_get(&wrf->f_path);
- f->f_mapping = wrf->f_path.dentry->d_inode->i_mapping;
-
- f->f_pos = 0;
f->f_flags = O_RDONLY | (flags & O_NONBLOCK);
- f->f_op = &read_pipefifo_fops;
- f->f_mode = FMODE_READ;
- f->f_version = 0;
return f;
}