unsigned long nr_segs, loff_t pos)
{
struct file *filp = iocb->ki_filp;
- struct pipe_inode_info *pipe = file_inode(filp)->i_pipe;
+ struct pipe_inode_info *pipe = filp->private_data;
int do_wakeup;
ssize_t ret;
struct iovec *iov = (struct iovec *)_iov;
unsigned long nr_segs, loff_t ppos)
{
struct file *filp = iocb->ki_filp;
- struct pipe_inode_info *pipe = file_inode(filp)->i_pipe;
+ struct pipe_inode_info *pipe = filp->private_data;
ssize_t ret;
int do_wakeup;
struct iovec *iov = (struct iovec *)_iov;
static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
- struct pipe_inode_info *pipe = file_inode(filp)->i_pipe;
+ struct pipe_inode_info *pipe = filp->private_data;
int count, buf, nrbufs;
switch (cmd) {
pipe_poll(struct file *filp, poll_table *wait)
{
unsigned int mask;
- struct pipe_inode_info *pipe = file_inode(filp)->i_pipe;
+ struct pipe_inode_info *pipe = filp->private_data;
int nrbufs;
poll_wait(filp, &pipe->wait, wait);
static int
pipe_fasync(int fd, struct file *filp, int on)
{
- struct pipe_inode_info *pipe = file_inode(filp)->i_pipe;
+ struct pipe_inode_info *pipe = filp->private_data;
int retval = 0;
pipe_lock(pipe);
goto err_dentry;
f->f_flags = O_WRONLY | (flags & (O_NONBLOCK | O_DIRECT));
+ f->private_data = inode->i_pipe;
res[0] = alloc_file(&path, FMODE_READ, &pipefifo_fops);
if (IS_ERR(res[0]))
goto err_file;
path_get(&path);
+ res[0]->private_data = inode->i_pipe;
res[0]->f_flags = O_RDONLY | (flags & O_NONBLOCK);
res[1] = f;
return 0;
spin_unlock(&inode->i_lock);
}
}
+ filp->private_data = pipe;
/* OK, we have a pipe and it's pinned down */
pipe_lock(pipe);
*/
struct pipe_inode_info *get_pipe_info(struct file *file)
{
- struct inode *i = file_inode(file);
-
- return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL;
+ return file->f_op == &pipefifo_fops ? file->private_data : NULL;
}
long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg)