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

Function __init_ring_with_region

test/reg-wait.c:39–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39static int __init_ring_with_region(struct io_uring *ring, unsigned ring_flags,
40 struct io_uring_mem_region_reg *pr,
41 bool disabled)
42{
43 int flags = disabled ? IORING_SETUP_R_DISABLED : 0;
44 int ret;
45
46 ret = io_uring_queue_init(8, ring, flags);
47 if (ret) {
48 if (ret != -EINVAL)
49 fprintf(stderr, "ring setup failed: %d\n", ret);
50 return ret;
51 }
52
53 ret = io_uring_register_region(ring, pr);
54 if (ret)
55 goto err;
56
57 if (disabled) {
58 ret = io_uring_enable_rings(ring);
59 if (ret) {
60 fprintf(stderr, "io_uring_enable_rings failure %i\n", ret);
61 goto err;
62 }
63 }
64 return 0;
65err:
66 io_uring_queue_exit(ring);
67 return ret;
68}
69
70static int page_size;
71static struct io_uring_reg_wait *reg;

Callers 1

test_try_register_regionFunction · 0.85

Calls 4

io_uring_queue_initFunction · 0.85
io_uring_register_regionFunction · 0.85
io_uring_enable_ringsFunction · 0.85
io_uring_queue_exitFunction · 0.85

Tested by 1

test_try_register_regionFunction · 0.68