Commit 6447a3cf authored by Al Viro's avatar Al Viro

get rid of pipe->inode

it's used only as a flag to distinguish normal pipes/FIFOs from the
internal per-task one used by file-to-file splice.  And pipe->files
would work just as well for that purpose...
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent ebec73f4
...@@ -1319,7 +1319,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos, ...@@ -1319,7 +1319,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
page_nr++; page_nr++;
ret += buf->len; ret += buf->len;
if (pipe->inode) if (pipe->files)
do_wakeup = 1; do_wakeup = 1;
} }
......
...@@ -55,7 +55,7 @@ unsigned int pipe_min_size = PAGE_SIZE; ...@@ -55,7 +55,7 @@ unsigned int pipe_min_size = PAGE_SIZE;
static void pipe_lock_nested(struct pipe_inode_info *pipe, int subclass) static void pipe_lock_nested(struct pipe_inode_info *pipe, int subclass)
{ {
if (pipe->inode) if (pipe->files)
mutex_lock_nested(&pipe->mutex, subclass); mutex_lock_nested(&pipe->mutex, subclass);
} }
...@@ -70,7 +70,7 @@ EXPORT_SYMBOL(pipe_lock); ...@@ -70,7 +70,7 @@ EXPORT_SYMBOL(pipe_lock);
void pipe_unlock(struct pipe_inode_info *pipe) void pipe_unlock(struct pipe_inode_info *pipe)
{ {
if (pipe->inode) if (pipe->files)
mutex_unlock(&pipe->mutex); mutex_unlock(&pipe->mutex);
} }
EXPORT_SYMBOL(pipe_unlock); EXPORT_SYMBOL(pipe_unlock);
...@@ -785,7 +785,6 @@ struct pipe_inode_info * alloc_pipe_info(struct inode *inode) ...@@ -785,7 +785,6 @@ struct pipe_inode_info * alloc_pipe_info(struct inode *inode)
if (pipe->bufs) { if (pipe->bufs) {
init_waitqueue_head(&pipe->wait); init_waitqueue_head(&pipe->wait);
pipe->r_counter = pipe->w_counter = 1; pipe->r_counter = pipe->w_counter = 1;
pipe->inode = inode;
pipe->buffers = PIPE_DEF_BUFFERS; pipe->buffers = PIPE_DEF_BUFFERS;
mutex_init(&pipe->mutex); mutex_init(&pipe->mutex);
return pipe; return pipe;
......
...@@ -218,7 +218,7 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe, ...@@ -218,7 +218,7 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
page_nr++; page_nr++;
ret += buf->len; ret += buf->len;
if (pipe->inode) if (pipe->files)
do_wakeup = 1; do_wakeup = 1;
if (!--spd->nr_pages) if (!--spd->nr_pages)
...@@ -828,7 +828,7 @@ int splice_from_pipe_feed(struct pipe_inode_info *pipe, struct splice_desc *sd, ...@@ -828,7 +828,7 @@ int splice_from_pipe_feed(struct pipe_inode_info *pipe, struct splice_desc *sd,
ops->release(pipe, buf); ops->release(pipe, buf);
pipe->curbuf = (pipe->curbuf + 1) & (pipe->buffers - 1); pipe->curbuf = (pipe->curbuf + 1) & (pipe->buffers - 1);
pipe->nrbufs--; pipe->nrbufs--;
if (pipe->inode) if (pipe->files)
sd->need_wakeup = true; sd->need_wakeup = true;
} }
......
...@@ -41,7 +41,6 @@ struct pipe_buffer { ...@@ -41,7 +41,6 @@ struct pipe_buffer {
* @w_counter: writer counter * @w_counter: writer counter
* @fasync_readers: reader side fasync * @fasync_readers: reader side fasync
* @fasync_writers: writer side fasync * @fasync_writers: writer side fasync
* @inode: inode this pipe is attached to
* @bufs: the circular array of pipe buffers * @bufs: the circular array of pipe buffers
**/ **/
struct pipe_inode_info { struct pipe_inode_info {
...@@ -57,7 +56,6 @@ struct pipe_inode_info { ...@@ -57,7 +56,6 @@ struct pipe_inode_info {
struct page *tmp_page; struct page *tmp_page;
struct fasync_struct *fasync_readers; struct fasync_struct *fasync_readers;
struct fasync_struct *fasync_writers; struct fasync_struct *fasync_writers;
struct inode *inode;
struct pipe_buffer *bufs; struct pipe_buffer *bufs;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment