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

Function _io_uring_get_sqe

src/include/liburing.h:1964–1978  ·  view source on GitHub ↗

* Return an sqe to fill. Application must later call io_uring_submit() * when it's ready to tell the kernel about it. The caller may call this * function multiple times before calling io_uring_submit(). * * Returns a vacant sqe, or NULL if we're full. */

Source from the content-addressed store, hash-verified

1962 * Returns a vacant sqe, or NULL if we're full.
1963 */
1964IOURINGINLINE struct io_uring_sqe *_io_uring_get_sqe(struct io_uring *ring)
1965 LIBURING_NOEXCEPT
1966{
1967 struct io_uring_sq *sq = &ring->sq;
1968 unsigned head = io_uring_load_sq_head(ring), tail = sq->sqe_tail;
1969 struct io_uring_sqe *sqe;
1970
1971 if (tail - head >= sq->ring_entries)
1972 return NULL;
1973
1974 sqe = &sq->sqes[(tail & sq->ring_mask) << io_uring_sqe_shift(ring)];
1975 sq->sqe_tail = tail + 1;
1976 io_uring_initialize_sqe(sqe);
1977 return sqe;
1978}
1979
1980/*
1981 * Return the appropriate mask for a buffer ring of size 'ring_entries'

Callers 3

io_uring_get_sqeFunction · 0.85
io_uring_get_sqeFunction · 0.85
io_uring_get_sqe128Function · 0.85

Calls 2

io_uring_load_sq_headFunction · 0.85
io_uring_sqe_shiftFunction · 0.85

Tested by

no test coverage detected