MCPcopy Create free account
hub / github.com/axboe/liburing / test_rw

Function test_rw

test/vec-regbuf.c:191–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191static int test_rw(struct buf_desc *bd, struct iovec *vecs, int nr_vec, int fd_wr)
192{
193 unsigned buf_idx = bd->buf_idx;
194 struct io_uring *ring = &bd->ring;
195 struct io_uring_sqe *sqe;
196 struct io_uring_cqe *cqe;
197 int ret;
198
199 sqe = io_uring_get_sqe(ring);
200 if (bd->fixed)
201 io_uring_prep_writev_fixed(sqe, fd_wr, vecs, nr_vec, 0, 0, buf_idx);
202 else
203 io_uring_prep_writev(sqe, fd_wr, vecs, nr_vec, 0);
204
205 ret = io_uring_submit(ring);
206 if (ret != 1) {
207 fprintf(stderr, "submit failed %i\n", ret);
208 exit(1);
209 }
210 ret = io_uring_wait_cqe(ring, &cqe);
211 if (ret) {
212 fprintf(stderr, "wait_cqe=%d\n", ret);
213 exit(1);
214 }
215
216 ret = cqe->res;
217 io_uring_cqe_seen(ring, cqe);
218 return ret;
219}
220
221static int test_sendzc(struct buf_desc *bd, struct iovec *vecs, int nr_vec, int fd_wr)
222{

Callers 1

test_vecFunction · 0.70

Calls 2

io_uring_submitFunction · 0.85
io_uring_get_sqeFunction · 0.50

Tested by

no test coverage detected