Lines Matching refs:nbytes
75 _init_kfifo(struct kfifo_meta *meta, size_t nbytes) in _init_kfifo() argument
81 meta->kfm_nbytes = nbytes; in _init_kfifo()
97 _kfifo_alloc(struct kfifo_meta *meta, void *bufp, size_t nbytes, gfp_t gfp) in _kfifo_alloc() argument
101 buf = kmalloc(nbytes, gfp); in _kfifo_alloc()
108 _init_kfifo(meta, nbytes); in _kfifo_alloc()
139 const size_t nbytes = meta->kfm_nbytes; in _kfifo_len() local
141 return (head <= tail ? tail - head : nbytes + tail - head); in _kfifo_len()
157 const size_t nbytes = meta->kfm_nbytes; in _kfifo_out_peek() local
164 if (size <= nbytes - head) { in _kfifo_out_peek()
167 } else if (size <= nbytes + tail - head) { in _kfifo_out_peek()
168 memcpy(dst, src + head, nbytes - head); in _kfifo_out_peek()
169 memcpy(dst + nbytes - head, src, in _kfifo_out_peek()
170 size - (nbytes - head)); in _kfifo_out_peek()
192 const size_t nbytes = meta->kfm_nbytes; in _kfifo_out() local
200 if (size <= nbytes - head) { in _kfifo_out()
204 } else if (size <= nbytes + tail - head) { in _kfifo_out()
205 memcpy(dst, src + head, nbytes - head); in _kfifo_out()
206 memcpy(dst + nbytes - head, src, in _kfifo_out()
207 size - (nbytes - head)); in _kfifo_out()
208 meta->kfm_head = size - (nbytes - head); in _kfifo_out()
230 const size_t nbytes = meta->kfm_nbytes; in _kfifo_in() local
238 if (size <= nbytes - tail) { in _kfifo_in()
241 } else if (size <= nbytes + tail - head) { in _kfifo_in()
242 memcpy(dst + tail, src, nbytes - tail); in _kfifo_in()
243 memcpy(dst, src + nbytes - tail, in _kfifo_in()
244 size - (nbytes - tail)); in _kfifo_in()
245 meta->kfm_tail = size - (nbytes - tail); in _kfifo_in()