4 ms·
In this code: for (i = 0; i < BUFS_IN_GROUP; i++) { /* add each buffer, we'll use i buffer ID */ io_uring_buf_ring_add(br, bufs[i], BUF_SIZE, i,
by twic 4y ago
In this code:
for (i = 0; i < BUFS_IN_GROUP; i++) {
/* add each buffer, we'll use i buffer ID */
io_uring_buf_ring_add(br, bufs[i], BUF_SIZE, i,
io_uring_buf_ring_mask(BUFS_IN_GROUP), i);
}
Where did bufs come from? Should that be br.bufs[i]?
- cgh 4y agoI think so, yes. struct io_uring_buf_ring is a union that includes a bufs member: struct io_uring_buf bufs[0];
- axboe 4y agoThe buffers are supplied elsewhere outside that example, just consider it an array of pointers to buffers of size BUF_SIZE. br->bufs[] is the shared space, it holds information on the address/size/id of a given buffer.
- espoal 4y agoi think it should be br[i]