Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58094
b: refs/heads/master
c: a66e356
h: refs/heads/master
v: v3
  • Loading branch information
Masami Hiramatsu authored and Linus Torvalds committed Jun 28, 2007
1 parent 11ae551 commit cd036da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d62fdebdaf9b866c7e236a8f5cfe90e6dba5773
refs/heads/master: a66e356c04ece4a96f44b942b68234c3de8ec3f5
8 changes: 6 additions & 2 deletions trunk/kernel/relay.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,10 @@ static void relay_file_read_consume(struct rchan_buf *buf,
}

buf->bytes_consumed += bytes_consumed;
read_subbuf = read_pos / buf->chan->subbuf_size;
if (!read_pos)
read_subbuf = buf->subbufs_consumed % n_subbufs;
else
read_subbuf = read_pos / buf->chan->subbuf_size;
if (buf->bytes_consumed + buf->padding[read_subbuf] == subbuf_size) {
if ((read_subbuf == buf->subbufs_produced % n_subbufs) &&
(buf->offset == subbuf_size))
Expand Down Expand Up @@ -841,8 +844,9 @@ static int relay_file_read_avail(struct rchan_buf *buf, size_t read_pos)
}

if (unlikely(produced - consumed >= n_subbufs)) {
consumed = (produced / n_subbufs) * n_subbufs;
consumed = produced - n_subbufs + 1;
buf->subbufs_consumed = consumed;
buf->bytes_consumed = 0;
}

produced = (produced % n_subbufs) * subbuf_size + buf->offset;
Expand Down

0 comments on commit cd036da

Please sign in to comment.