Lines Matching refs:sq

55 	struct io_uring_sq sq;  member
69 struct io_uring_sq *sq, struct io_uring_cq *cq) in io_uring_mmap() argument
75 sq->ring_sz = p->sq_off.array + p->sq_entries * sizeof(unsigned int); in io_uring_mmap()
76 ptr = mmap(0, sq->ring_sz, PROT_READ | PROT_WRITE, in io_uring_mmap()
80 sq->khead = ptr + p->sq_off.head; in io_uring_mmap()
81 sq->ktail = ptr + p->sq_off.tail; in io_uring_mmap()
82 sq->kring_mask = ptr + p->sq_off.ring_mask; in io_uring_mmap()
83 sq->kring_entries = ptr + p->sq_off.ring_entries; in io_uring_mmap()
84 sq->kflags = ptr + p->sq_off.flags; in io_uring_mmap()
85 sq->kdropped = ptr + p->sq_off.dropped; in io_uring_mmap()
86 sq->array = ptr + p->sq_off.array; in io_uring_mmap()
89 sq->sqes = mmap(0, size, PROT_READ | PROT_WRITE, in io_uring_mmap()
91 if (sq->sqes == MAP_FAILED) { in io_uring_mmap()
94 munmap(sq->khead, sq->ring_sz); in io_uring_mmap()
103 munmap(sq->sqes, p->sq_entries * sizeof(struct io_uring_sqe)); in io_uring_mmap()
143 ret = io_uring_mmap(fd, &p, &ring->sq, &ring->cq); in io_uring_queue_init()
154 struct io_uring_sq *sq = &ring->sq; in io_uring_get_sqe() local
156 if (sq->sqe_tail + 1 - sq->sqe_head > *sq->kring_entries) in io_uring_get_sqe()
158 return &sq->sqes[sq->sqe_tail++ & *sq->kring_mask]; in io_uring_get_sqe()
187 struct io_uring_sq *sq = &ring->sq; in io_uring_submit() local
188 const unsigned int mask = *sq->kring_mask; in io_uring_submit()
193 if (*sq->khead != *sq->ktail) { in io_uring_submit()
194 submitted = *sq->kring_entries; in io_uring_submit()
197 if (sq->sqe_head == sq->sqe_tail) in io_uring_submit()
200 ktail = *sq->ktail; in io_uring_submit()
201 to_submit = sq->sqe_tail - sq->sqe_head; in io_uring_submit()
204 sq->array[ktail++ & mask] = sq->sqe_head++ & mask; in io_uring_submit()
209 if (*sq->ktail != ktail) { in io_uring_submit()
211 *sq->ktail = ktail; in io_uring_submit()
222 struct io_uring_sq *sq = &ring->sq; in io_uring_queue_exit() local
224 munmap(sq->sqes, *sq->kring_entries * sizeof(struct io_uring_sqe)); in io_uring_queue_exit()
225 munmap(sq->khead, sq->ring_sz); in io_uring_queue_exit()