summaryrefslogtreecommitdiffstats
path: root/fs/pipe.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-06-17 20:15:10 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2018-07-12 16:04:28 +0200
commit183266f26f45a47958afb5c9aa1b3d4651e2eb8c (patch)
treec420683235aab835020701a456a62cd786a02c68 /fs/pipe.c
parentcreate_pipe_files(): switch the first allocation to alloc_file_pseudo() (diff)
downloadlinux-183266f26f45a47958afb5c9aa1b3d4651e2eb8c.tar.xz
linux-183266f26f45a47958afb5c9aa1b3d4651e2eb8c.zip
new helper: alloc_file_clone()
alloc_file_clone(old_file, mode, ops): create a new struct file with ->f_path equal to that of old_file. pipe converted. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/pipe.c')
-rw-r--r--fs/pipe.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index 9701bd3458d1..5f50070774bc 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -761,15 +761,13 @@ int create_pipe_files(struct file **res, int flags)
f->private_data = inode->i_pipe;
- res[0] = alloc_file(&f->f_path, O_RDONLY | (flags & O_NONBLOCK),
- &pipefifo_fops);
+ res[0] = alloc_file_clone(f, O_RDONLY | (flags & O_NONBLOCK),
+ &pipefifo_fops);
if (IS_ERR(res[0])) {
put_pipe_info(inode, inode->i_pipe);
fput(f);
return PTR_ERR(res[0]);
}
-
- path_get(&f->f_path);
res[0]->private_data = inode->i_pipe;
res[1] = f;
return 0;