@@ -818,7 +818,7 @@ void io_req_cqe_overflow(struct io_kiocb *req)
818
818
* control dependency is enough as we're using WRITE_ONCE to
819
819
* fill the cq entry
820
820
*/
821
- struct io_uring_cqe * __io_get_cqe (struct io_ring_ctx * ctx , bool overflow )
821
+ bool io_cqe_cache_refill (struct io_ring_ctx * ctx , bool overflow )
822
822
{
823
823
struct io_rings * rings = ctx -> rings ;
824
824
unsigned int off = ctx -> cached_cq_tail & (ctx -> cq_entries - 1 );
@@ -830,15 +830,15 @@ struct io_uring_cqe *__io_get_cqe(struct io_ring_ctx *ctx, bool overflow)
830
830
* Force overflow the completion.
831
831
*/
832
832
if (!overflow && (ctx -> check_cq & BIT (IO_CHECK_CQ_OVERFLOW_BIT )))
833
- return NULL ;
833
+ return false ;
834
834
835
835
/* userspace may cheat modifying the tail, be safe and do min */
836
836
queued = min (__io_cqring_events (ctx ), ctx -> cq_entries );
837
837
free = ctx -> cq_entries - queued ;
838
838
/* we need a contiguous range, limit based on the current array offset */
839
839
len = min (free , ctx -> cq_entries - off );
840
840
if (!len )
841
- return NULL ;
841
+ return false ;
842
842
843
843
if (ctx -> flags & IORING_SETUP_CQE32 ) {
844
844
off <<= 1 ;
@@ -847,12 +847,7 @@ struct io_uring_cqe *__io_get_cqe(struct io_ring_ctx *ctx, bool overflow)
847
847
848
848
ctx -> cqe_cached = & rings -> cqes [off ];
849
849
ctx -> cqe_sentinel = ctx -> cqe_cached + len ;
850
-
851
- ctx -> cached_cq_tail ++ ;
852
- ctx -> cqe_cached ++ ;
853
- if (ctx -> flags & IORING_SETUP_CQE32 )
854
- ctx -> cqe_cached ++ ;
855
- return & rings -> cqes [off ];
850
+ return true;
856
851
}
857
852
858
853
static bool io_fill_cqe_aux (struct io_ring_ctx * ctx , u64 user_data , s32 res ,
0 commit comments