Skip to content

Commit

Permalink
relay: set an spd_release() hook for splice
Browse files Browse the repository at this point in the history
relay doesn't reference the pages it adds, however we need a non-NULL
hook or splice_to_pipe() can oops.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Jens Axboe committed Mar 26, 2008
1 parent 37529fe commit 5eb7f9f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/relay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,10 @@ static struct pipe_buf_operations relay_pipe_buf_ops = {
.get = generic_pipe_buf_get,
};

static void relay_page_release(struct splice_pipe_desc *spd, unsigned int i)
{
}

/*
* subbuf_splice_actor - splice up to one subbuf's worth of data
*/
Expand Down Expand Up @@ -1083,6 +1087,7 @@ static int subbuf_splice_actor(struct file *in,
.partial = partial,
.flags = flags,
.ops = &relay_pipe_buf_ops,
.spd_release = relay_page_release,
};

if (rbuf->subbufs_produced == rbuf->subbufs_consumed)
Expand Down

0 comments on commit 5eb7f9f

Please sign in to comment.