Lines Matching full:cap
22 * @cap: Maximum capacity of the buffer.
27 size_t cap; member
34 * @cap: The length of the memory backing the buffer, i.e. its capacity.
39 static inline void sshp_buf_init(struct sshp_buf *buf, u8 *ptr, size_t cap) in sshp_buf_init() argument
43 buf->cap = cap; in sshp_buf_init()
49 * @cap: The desired capacity of the buffer.
52 * Allocates @cap bytes and initializes the provided buffer struct with the
57 static inline int sshp_buf_alloc(struct sshp_buf *buf, size_t cap, gfp_t flags) in sshp_buf_alloc() argument
61 ptr = kzalloc(cap, flags); in sshp_buf_alloc()
65 sshp_buf_init(buf, ptr, cap); in sshp_buf_alloc()
82 buf->cap = 0; in sshp_buf_free()
116 n = kfifo_out(fifo, buf->ptr + buf->len, buf->cap - buf->len); in sshp_buf_read_from_fifo()