Skip to content

Commit

Permalink
splice: only check do_wakeup in splice_to_pipe() for a real pipe
Browse files Browse the repository at this point in the history
We only ever set do_wakeup to non-zero if the pipe has an inode
backing, so it's pointless to check outside the pipe->inode
check.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Jens Axboe committed Jun 15, 2007
1 parent 00de00b commit 02676e5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,15 @@ static ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
pipe->waiting_writers--;
}

if (pipe->inode)
if (pipe->inode) {
mutex_unlock(&pipe->inode->i_mutex);

if (do_wakeup) {
smp_mb();
if (waitqueue_active(&pipe->wait))
wake_up_interruptible(&pipe->wait);
kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
if (do_wakeup) {
smp_mb();
if (waitqueue_active(&pipe->wait))
wake_up_interruptible(&pipe->wait);
kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
}
}

while (page_nr < spd_pages)
Expand Down

0 comments on commit 02676e5

Please sign in to comment.