diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-03-06 18:42:32 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-03-06 18:42:32 -0500 |
commit | f64f76b55400b71e8576ed7e4a377eb5ef9576aa (patch) | |
tree | f82042d599d09395474e2b6b8c0a248e63b9da9f /src/ioq.c | |
parent | 61adc84620e90c3380c785d559137fac487a301c (diff) | |
download | bfs-f64f76b55400b71e8576ed7e4a377eb5ef9576aa.tar.xz |
ioq: Copy ring_ops from the previous thread
Otherwise threads 2-N won't use io_uring at all! Oops.
Fixes: 8bc72d6c ("ioq: Probe for supported io_uring operations")
Diffstat (limited to 'src/ioq.c')
-rw-r--r-- | src/ioq.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -850,6 +850,7 @@ static int ioq_ring_init(struct ioq *ioq, struct ioq_thread *thread) { if (prev) { // Initial setup already complete + thread->ring_ops = prev->ring_ops; return 0; } @@ -916,12 +917,14 @@ static void ioq_thread_join(struct ioq_thread *thread) { } struct ioq *ioq_create(size_t depth, size_t nthreads) { - struct ioq *ioq = ZALLOC_FLEX(struct ioq, threads, nthreads); + struct ioq *ioq = ALLOC_FLEX(struct ioq, threads, nthreads); if (!ioq) { goto fail; } ioq->depth = depth; + ioq->size = 0; + ioq->cancel = false; ARENA_INIT(&ioq->ents, struct ioq_ent); |