* Submit sqes acquired from io_uring_get_sqe() to the kernel. * * Returns number of sqes submitted */
| 478 | * Returns number of sqes submitted |
| 479 | */ |
| 480 | static int __io_uring_submit(struct io_uring *ring, unsigned submitted, |
| 481 | unsigned wait_nr, bool getevents) |
| 482 | { |
| 483 | bool cq_needs_enter = getevents || wait_nr || cq_ring_needs_enter(ring); |
| 484 | unsigned flags = ring_enter_flags(ring); |
| 485 | int ret; |
| 486 | |
| 487 | liburing_sanitize_ring(ring); |
| 488 | |
| 489 | if (sq_ring_needs_enter(ring, submitted, &flags) || cq_needs_enter) { |
| 490 | if (cq_needs_enter) |
| 491 | flags |= IORING_ENTER_GETEVENTS; |
| 492 | |
| 493 | ret = __sys_io_uring_enter(ring->enter_ring_fd, submitted, |
| 494 | wait_nr, flags, NULL); |
| 495 | } else |
| 496 | ret = submitted; |
| 497 | |
| 498 | return ret; |
| 499 | } |
| 500 | |
| 501 | static int __io_uring_submit_and_wait(struct io_uring *ring, unsigned wait_nr) |
| 502 | { |
no test coverage detected