Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d231412d authored by Al Viro's avatar Al Viro
Browse files

switch create_read_pipe() to alloc_file()



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 2c48b9c4
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -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;
}