diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-21 10:07:59 +0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-04-09 22:12:59 +0400 |
commit | fc7478a2bfa9abd19657d2bbc9ae24185a41e21b (patch) | |
tree | 3db04ffa77f2050b3c10fa9fdcb1798ba0ce4f71 /fs/pipe.c | |
parent | 599a0ac14e065b7c08471ef2e75a504b7dec9267 (diff) | |
download | linux-fc7478a2bfa9abd19657d2bbc9ae24185a41e21b.tar.xz |
pipe: switch wait_for_partner() and wake_up_partner() to pipe_inode_info
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/pipe.c')
-rw-r--r-- | fs/pipe.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/pipe.c b/fs/pipe.c index 099ac3bf89f9..105b0021b075 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -986,21 +986,21 @@ SYSCALL_DEFINE1(pipe, int __user *, fildes) return sys_pipe2(fildes, 0); } -static int wait_for_partner(struct inode* inode, unsigned int *cnt) +static int wait_for_partner(struct pipe_inode_info *pipe, unsigned int *cnt) { int cur = *cnt; while (cur == *cnt) { - pipe_wait(inode->i_pipe); + pipe_wait(pipe); if (signal_pending(current)) break; } return cur == *cnt ? -ERESTARTSYS : 0; } -static void wake_up_partner(struct inode* inode) +static void wake_up_partner(struct pipe_inode_info *pipe) { - wake_up_interruptible(&inode->i_pipe->wait); + wake_up_interruptible(&pipe->wait); } static int fifo_open(struct inode *inode, struct file *filp) @@ -1032,7 +1032,7 @@ static int fifo_open(struct inode *inode, struct file *filp) */ pipe->r_counter++; if (pipe->readers++ == 0) - wake_up_partner(inode); + wake_up_partner(pipe); if (!is_pipe && !pipe->writers) { if ((filp->f_flags & O_NONBLOCK)) { @@ -1040,7 +1040,7 @@ static int fifo_open(struct inode *inode, struct file *filp) * seen a writer */ filp->f_version = pipe->w_counter; } else { - if (wait_for_partner(inode, &pipe->w_counter)) + if (wait_for_partner(pipe, &pipe->w_counter)) goto err_rd; } } @@ -1058,10 +1058,10 @@ static int fifo_open(struct inode *inode, struct file *filp) pipe->w_counter++; if (!pipe->writers++) - wake_up_partner(inode); + wake_up_partner(pipe); if (!is_pipe && !pipe->readers) { - if (wait_for_partner(inode, &pipe->r_counter)) + if (wait_for_partner(pipe, &pipe->r_counter)) goto err_wr; } break; @@ -1079,7 +1079,7 @@ static int fifo_open(struct inode *inode, struct file *filp) pipe->r_counter++; pipe->w_counter++; if (pipe->readers == 1 || pipe->writers == 1) - wake_up_partner(inode); + wake_up_partner(pipe); break; default: |