Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Browse files Browse the repository at this point in the history
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  relay: set an spd_release() hook for splice
  set relay file can not be read by pread(2)
  • Loading branch information
Linus Torvalds committed Mar 26, 2008
2 parents c8237a5 + 5eb7f9f commit 729eb52
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kernel/relay.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ static int relay_file_open(struct inode *inode, struct file *filp)
kref_get(&buf->kref);
filp->private_data = buf;

return 0;
return nonseekable_open(inode, filp);
}

/**
Expand Down 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 729eb52

Please sign in to comment.