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

Function test_sparse

test/file-register.c:305–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303}
304
305static int test_sparse(struct io_uring *ring)
306{
307 int *files;
308 int ret;
309
310 files = open_files(100, 100, 0);
311 ret = io_uring_register_files(ring, files, 200);
312 if (ret) {
313 if (ret == -EBADF || ret == -EINVAL) {
314 fprintf(stdout, "Sparse files not supported, skipping\n");
315 no_update = 1;
316 goto done;
317 }
318 fprintf(stderr, "%s: register ret=%d\n", __FUNCTION__, ret);
319 goto err;
320 }
321 ret = io_uring_unregister_files(ring);
322 if (ret) {
323 fprintf(stderr, "%s: unregister ret=%d\n", __FUNCTION__, ret);
324 goto err;
325 }
326done:
327 close_files(files, 100, 0);
328 return 0;
329err:
330 close_files(files, 100, 0);
331 return 1;
332}
333
334static int test_basic_many(struct io_uring *ring)
335{

Callers 1

mainFunction · 0.85

Calls 4

io_uring_register_filesFunction · 0.85
open_filesFunction · 0.70
close_filesFunction · 0.70

Tested by

no test coverage detected