Lines Matching refs:n_subbufs
151 if (chan->n_subbufs > KMALLOC_MAX_SIZE / sizeof(size_t *)) in relay_create_buf()
157 buf->padding = kmalloc_array(chan->n_subbufs, sizeof(size_t *), in relay_create_buf()
244 return (ready >= buf->chan->n_subbufs) ? 1 : 0; in relay_buf_full()
302 for (i = 0; i < buf->chan->n_subbufs; i++) in __relay_reset()
477 size_t n_subbufs, in relay_open() argument
485 if (!(subbuf_size && n_subbufs)) in relay_open()
487 if (subbuf_size > UINT_MAX / n_subbufs) in relay_open()
503 chan->n_subbufs = n_subbufs; in relay_open()
505 chan->alloc_size = PAGE_ALIGN(subbuf_size * n_subbufs); in relay_open()
669 old_subbuf = buf->subbufs_produced % buf->chan->n_subbufs; in relay_switch_subbuf()
692 new_subbuf = buf->subbufs_produced % buf->chan->n_subbufs; in relay_switch_subbuf()
736 if (!buf || subbufs_consumed > chan->n_subbufs) in relay_subbufs_consumed()
883 size_t n_subbufs = buf->chan->n_subbufs; in relay_file_read_consume() local
897 read_subbuf = buf->subbufs_consumed % n_subbufs; in relay_file_read_consume()
901 if ((read_subbuf == buf->subbufs_produced % n_subbufs) && in relay_file_read_consume()
915 size_t n_subbufs = buf->chan->n_subbufs; in relay_file_read_avail() local
929 if (unlikely(produced - consumed >= n_subbufs)) { in relay_file_read_avail()
930 consumed = produced - n_subbufs + 1; 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()
990 size_t n_subbufs = buf->chan->n_subbufs; in relay_file_read_start_pos() local
991 size_t consumed = buf->subbufs_consumed % n_subbufs; in relay_file_read_start_pos()
999 read_subbuf = (read_subbuf + 1) % n_subbufs; in relay_file_read_start_pos()
1018 size_t n_subbufs = buf->chan->n_subbufs; in relay_file_read_end_pos() local
1026 if (end_pos >= subbuf_size * n_subbufs) in relay_file_read_end_pos()