sched/wait: Make the __wait_event*() interface more friendly
Change all __wait_event*() implementations to match the corresponding wait_event*() signature for convenience. In particular this does away with the weird 'ret' logic. Since there are __wait_event*() users this requires we update them too. Reviewed-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20131002092529.042563462@infradead.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:

committed by
Ingo Molnar

parent
ebdc195f2e
commit
35a2af94c7
@@ -172,8 +172,9 @@ int rtlx_open(int index, int can_sleep)
|
||||
if (rtlx == NULL) {
|
||||
if( (p = vpe_get_shared(tclimit)) == NULL) {
|
||||
if (can_sleep) {
|
||||
__wait_event_interruptible(channel_wqs[index].lx_queue,
|
||||
(p = vpe_get_shared(tclimit)), ret);
|
||||
ret = __wait_event_interruptible(
|
||||
channel_wqs[index].lx_queue,
|
||||
(p = vpe_get_shared(tclimit)));
|
||||
if (ret)
|
||||
goto out_fail;
|
||||
} else {
|
||||
@@ -263,11 +264,10 @@ unsigned int rtlx_read_poll(int index, int can_sleep)
|
||||
/* data available to read? */
|
||||
if (chan->lx_read == chan->lx_write) {
|
||||
if (can_sleep) {
|
||||
int ret = 0;
|
||||
|
||||
__wait_event_interruptible(channel_wqs[index].lx_queue,
|
||||
int ret = __wait_event_interruptible(
|
||||
channel_wqs[index].lx_queue,
|
||||
(chan->lx_read != chan->lx_write) ||
|
||||
sp_stopping, ret);
|
||||
sp_stopping);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -440,14 +440,13 @@ static ssize_t file_write(struct file *file, const char __user * buffer,
|
||||
|
||||
/* any space left... */
|
||||
if (!rtlx_write_poll(minor)) {
|
||||
int ret = 0;
|
||||
int ret;
|
||||
|
||||
if (file->f_flags & O_NONBLOCK)
|
||||
return -EAGAIN;
|
||||
|
||||
__wait_event_interruptible(channel_wqs[minor].rt_queue,
|
||||
rtlx_write_poll(minor),
|
||||
ret);
|
||||
ret = __wait_event_interruptible(channel_wqs[minor].rt_queue,
|
||||
rtlx_write_poll(minor));
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user