diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/relay.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/relay.c b/kernel/relay.c index 3b299fb3855c..a615a8f513fc 100644 --- a/kernel/relay.c +++ b/kernel/relay.c | |||
@@ -1061,7 +1061,7 @@ static struct pipe_buf_operations relay_pipe_buf_ops = { | |||
1061 | .get = generic_pipe_buf_get, | 1061 | .get = generic_pipe_buf_get, |
1062 | }; | 1062 | }; |
1063 | 1063 | ||
1064 | /** | 1064 | /* |
1065 | * subbuf_splice_actor - splice up to one subbuf's worth of data | 1065 | * subbuf_splice_actor - splice up to one subbuf's worth of data |
1066 | */ | 1066 | */ |
1067 | static int subbuf_splice_actor(struct file *in, | 1067 | static int subbuf_splice_actor(struct file *in, |
@@ -1074,7 +1074,9 @@ static int subbuf_splice_actor(struct file *in, | |||
1074 | unsigned int pidx, poff, total_len, subbuf_pages, ret; | 1074 | unsigned int pidx, poff, total_len, subbuf_pages, ret; |
1075 | struct rchan_buf *rbuf = in->private_data; | 1075 | struct rchan_buf *rbuf = in->private_data; |
1076 | unsigned int subbuf_size = rbuf->chan->subbuf_size; | 1076 | unsigned int subbuf_size = rbuf->chan->subbuf_size; |
1077 | size_t read_start = ((size_t)*ppos) % rbuf->chan->alloc_size; | 1077 | uint64_t pos = (uint64_t) *ppos; |
1078 | uint32_t alloc_size = (uint32_t) rbuf->chan->alloc_size; | ||
1079 | size_t read_start = (size_t) do_div(pos, alloc_size); | ||
1078 | size_t read_subbuf = read_start / subbuf_size; | 1080 | size_t read_subbuf = read_start / subbuf_size; |
1079 | size_t padding = rbuf->padding[read_subbuf]; | 1081 | size_t padding = rbuf->padding[read_subbuf]; |
1080 | size_t nonpad_end = read_subbuf * subbuf_size + subbuf_size - padding; | 1082 | size_t nonpad_end = read_subbuf * subbuf_size + subbuf_size - padding; |