Read the kernel's SQ head index with appropriate memory ordering */
| 1706 | |
| 1707 | /* Read the kernel's SQ head index with appropriate memory ordering */ |
| 1708 | IOURINGINLINE unsigned io_uring_load_sq_head(const struct io_uring *ring) |
| 1709 | LIBURING_NOEXCEPT |
| 1710 | { |
| 1711 | /* |
| 1712 | * Without acquire ordering, we could overwrite a SQE before the kernel |
| 1713 | * finished reading it. We don't need the acquire ordering for |
| 1714 | * non-SQPOLL since then we drive updates. |
| 1715 | */ |
| 1716 | if (ring->flags & IORING_SETUP_SQPOLL) |
| 1717 | return io_uring_smp_load_acquire(ring->sq.khead); |
| 1718 | |
| 1719 | return *ring->sq.khead; |
| 1720 | } |
| 1721 | |
| 1722 | /* |
| 1723 | * Returns number of unconsumed (if SQPOLL) or unsubmitted entries exist in |
no outgoing calls
no test coverage detected