Lines Matching refs:subbuf_size
476 size_t subbuf_size, in relay_open() argument
485 if (!(subbuf_size && n_subbufs)) in relay_open()
487 if (subbuf_size > UINT_MAX / n_subbufs) in relay_open()
504 chan->subbuf_size = subbuf_size; in relay_open()
505 chan->alloc_size = PAGE_ALIGN(subbuf_size * n_subbufs); in relay_open()
664 if (unlikely(length > buf->chan->subbuf_size)) in relay_switch_subbuf()
667 if (buf->offset != buf->chan->subbuf_size + 1) { in relay_switch_subbuf()
668 buf->prev_padding = buf->chan->subbuf_size - buf->offset; in relay_switch_subbuf()
674 buf->chan->subbuf_size - in relay_switch_subbuf()
677 buf->early_bytes += buf->chan->subbuf_size - in relay_switch_subbuf()
693 new = buf->start + new_subbuf * buf->chan->subbuf_size; in relay_switch_subbuf()
696 buf->offset = buf->chan->subbuf_size + 1; in relay_switch_subbuf()
702 if (unlikely(length + buf->offset > buf->chan->subbuf_size)) in relay_switch_subbuf()
771 chan->last_toobig, chan->subbuf_size); in relay_close()
882 size_t subbuf_size = buf->chan->subbuf_size; in relay_file_read_consume() local
890 if (buf->bytes_consumed + bytes_consumed > subbuf_size) { in relay_file_read_consume()
899 read_subbuf = read_pos / buf->chan->subbuf_size; in relay_file_read_consume()
900 if (buf->bytes_consumed + buf->padding[read_subbuf] == subbuf_size) { in relay_file_read_consume()
902 (buf->offset == subbuf_size)) in relay_file_read_consume()
914 size_t subbuf_size = buf->chan->subbuf_size; in relay_file_read_avail() local
923 if (unlikely(buf->offset > subbuf_size)) { in relay_file_read_avail()
935 produced = (produced % n_subbufs) * subbuf_size + buf->offset; in relay_file_read_avail()
936 consumed = (consumed % n_subbufs) * subbuf_size + buf->bytes_consumed; in relay_file_read_avail()
939 produced += n_subbufs * subbuf_size; in relay_file_read_avail()
942 if (buf->offset == subbuf_size && in relay_file_read_avail()
961 size_t subbuf_size = buf->chan->subbuf_size; in relay_file_read_subbuf_avail() local
963 write_subbuf = (buf->data - buf->start) / subbuf_size; in relay_file_read_subbuf_avail()
964 write_offset = buf->offset > subbuf_size ? subbuf_size : buf->offset; in relay_file_read_subbuf_avail()
965 read_subbuf = read_pos / subbuf_size; in relay_file_read_subbuf_avail()
966 read_offset = read_pos % subbuf_size; in relay_file_read_subbuf_avail()
973 avail = (subbuf_size - padding) - read_offset; in relay_file_read_subbuf_avail()
989 size_t subbuf_size = buf->chan->subbuf_size; in relay_file_read_start_pos() local
992 size_t read_pos = (consumed * subbuf_size + buf->bytes_consumed) in relay_file_read_start_pos()
993 % (n_subbufs * subbuf_size); in relay_file_read_start_pos()
995 read_subbuf = read_pos / subbuf_size; in relay_file_read_start_pos()
997 padding_start = (read_subbuf + 1) * subbuf_size - padding; in relay_file_read_start_pos()
998 padding_end = (read_subbuf + 1) * subbuf_size; in relay_file_read_start_pos()
1001 read_pos = read_subbuf * subbuf_size; in relay_file_read_start_pos()
1018 size_t subbuf_size = buf->chan->subbuf_size; in relay_file_read_end_pos() local
1021 read_subbuf = read_pos / subbuf_size; in relay_file_read_end_pos()
1023 if (read_pos % subbuf_size + count + padding == subbuf_size) in relay_file_read_end_pos()
1024 end_pos = (read_subbuf + 1) * subbuf_size; in relay_file_read_end_pos()
1027 if (end_pos >= subbuf_size * n_subbufs) in relay_file_read_end_pos()
1080 if (rbuf->bytes_consumed >= rbuf->chan->subbuf_size) { in relay_consume_bytes()
1082 rbuf->bytes_consumed %= rbuf->chan->subbuf_size; in relay_consume_bytes()
1117 unsigned int subbuf_size = rbuf->chan->subbuf_size; in subbuf_splice_actor() local
1121 size_t read_subbuf = read_start / subbuf_size; in subbuf_splice_actor()
1123 size_t nonpad_end = read_subbuf * subbuf_size + subbuf_size - padding; in subbuf_splice_actor()
1144 if (len > (subbuf_size - read_start % subbuf_size)) in subbuf_splice_actor()
1145 len = subbuf_size - read_start % subbuf_size; in subbuf_splice_actor()