mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
152b6372c9
commit
183266f26f
3 changed files with 15 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue