File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -533,6 +533,14 @@ static bool io_poll_can_finish_inline(struct io_kiocb *req,
533
533
return pt -> owning || io_poll_get_ownership (req );
534
534
}
535
535
536
+ static void io_poll_add_hash (struct io_kiocb * req )
537
+ {
538
+ if (req -> flags & REQ_F_HASH_LOCKED )
539
+ io_poll_req_insert_locked (req );
540
+ else
541
+ io_poll_req_insert (req );
542
+ }
543
+
536
544
/*
537
545
* Returns 0 when it's handed over for polling. The caller owns the requests if
538
546
* it returns non-zero, but otherwise should not touch it. Negative values
@@ -591,18 +599,17 @@ static int __io_arm_poll_handler(struct io_kiocb *req,
591
599
592
600
if (mask &&
593
601
((poll -> events & (EPOLLET |EPOLLONESHOT )) == (EPOLLET |EPOLLONESHOT ))) {
594
- if (!io_poll_can_finish_inline (req , ipt ))
602
+ if (!io_poll_can_finish_inline (req , ipt )) {
603
+ io_poll_add_hash (req );
595
604
return 0 ;
605
+ }
596
606
io_poll_remove_entries (req );
597
607
ipt -> result_mask = mask ;
598
608
/* no one else has access to the req, forget about the ref */
599
609
return 1 ;
600
610
}
601
611
602
- if (req -> flags & REQ_F_HASH_LOCKED )
603
- io_poll_req_insert_locked (req );
604
- else
605
- io_poll_req_insert (req );
612
+ io_poll_add_hash (req );
606
613
607
614
if (mask && (poll -> events & EPOLLET ) &&
608
615
io_poll_can_finish_inline (req , ipt )) {
You can’t perform that action at this time.
0 commit comments