File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -400,6 +400,11 @@ static unsigned rq_nr_queued(struct io_uring_zcrx_rq *rq)
400400 return rq -> rq_tail - io_uring_smp_load_acquire (rq -> khead );
401401}
402402
403+ static bool rq_is_full (struct io_uring_zcrx_rq * rq )
404+ {
405+ return rq_nr_queued (rq ) == rq -> ring_entries ;
406+ }
407+
403408static inline void fill_rqe (const struct io_uring_cqe * cqe ,
404409 struct io_uring_zcrx_rqe * rqe )
405410{
@@ -430,7 +435,7 @@ static bool flush_refill_queue(struct io_uring *ring,
430435 }
431436
432437 /* should never happen */
433- if (rq_nr_queued (rq_ring ) == rq_ring -> ring_entries )
438+ if (rq_is_full (rq_ring ))
434439 t_error (1 , 0 , "Couldn't flush refill ring\n" );
435440 return true;
436441}
@@ -442,8 +447,7 @@ static void return_buffer(struct io_uring *ring,
442447 struct io_uring_zcrx_rqe * rqe ;
443448 unsigned rq_mask ;
444449
445- if (rq_nr_queued (rq_ring ) == rq_ring -> ring_entries &&
446- !flush_refill_queue (ring , rq_ring )) {
450+ if (rq_is_full (rq_ring ) && !flush_refill_queue (ring , rq_ring )) {
447451 printf ("RQ is full, drop the buffer\n" );
448452 return ;
449453 }
You can’t perform that action at this time.
0 commit comments