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

Function submit_io

test/io_uring_enter.c:151–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151static void submit_io(struct io_uring *ring, unsigned nr)
152{
153 int fd, ret;
154 off_t file_len;
155 unsigned i;
156 static char template[32] = "/tmp/io_uring_enter-test.XXXXXX";
157 struct io_uring_sqe *sqe;
158
159 file_len = nr * 4096;
160 fd = setup_file(template, file_len);
161 for (i = 0; i < nr; i++) {
162 /* allocate an sqe */
163 sqe = io_uring_get_sqe(ring);
164 /* fill it in */
165 io_prep_read(sqe, fd, i * 4096, 4096);
166 }
167
168 /* submit the I/Os */
169 ret = io_uring_submit(ring);
170 unlink(template);
171 if (ret < 0) {
172 fprintf(stderr, "io_uring_queue_enter: %s\n", strerror(-ret));
173 exit(1);
174 }
175}
176
177int main(int argc, char **argv)
178{

Callers 1

mainFunction · 0.85

Calls 4

setup_fileFunction · 0.85
io_prep_readFunction · 0.85
io_uring_submitFunction · 0.85
io_uring_get_sqeFunction · 0.50

Tested by

no test coverage detected