* Special cased for SQPOLL only, as we don't control when SQEs are consumed if * that is used. Hence we may need to wait for the SQPOLL thread to keep up * until we can get a new SQE. All other cases will break immediately, with a * fresh SQE. * * If we grossly undersized our SQ ring, getting a NULL sqe can happen even * for the !SQPOLL case if we're handling a lot of CQEs in our event loop
| 654 | * a single submission cycle. |
| 655 | */ |
| 656 | static struct io_uring_sqe *get_sqe(struct io_uring *ring) |
| 657 | { |
| 658 | struct io_uring_sqe *sqe; |
| 659 | |
| 660 | do { |
| 661 | sqe = io_uring_get_sqe(ring); |
| 662 | if (sqe) |
| 663 | break; |
| 664 | if (!sqpoll) |
| 665 | io_uring_submit(ring); |
| 666 | else |
| 667 | io_uring_sqring_wait(ring); |
| 668 | } while (1); |
| 669 | |
| 670 | return sqe; |
| 671 | } |
| 672 | |
| 673 | /* |
| 674 | * See __encode_userdata() for how we encode sqe->user_data, which is passed |
no test coverage detected