@@ -67,8 +67,6 @@ struct io_sr_msg {
67
67
struct io_kiocb * notif ;
68
68
};
69
69
70
- #define IO_APOLL_MULTI_POLLED (REQ_F_APOLL_MULTISHOT | REQ_F_POLLED)
71
-
72
70
int io_shutdown_prep (struct io_kiocb * req , const struct io_uring_sqe * sqe )
73
71
{
74
72
struct io_shutdown * shutdown = io_kiocb_to_cmd (req , struct io_shutdown );
@@ -591,7 +589,8 @@ static inline void io_recv_prep_retry(struct io_kiocb *req)
591
589
* again (for multishot).
592
590
*/
593
591
static inline bool io_recv_finish (struct io_kiocb * req , int * ret ,
594
- unsigned int cflags , bool mshot_finished )
592
+ unsigned int cflags , bool mshot_finished ,
593
+ unsigned issue_flags )
595
594
{
596
595
if (!(req -> flags & REQ_F_APOLL_MULTISHOT )) {
597
596
io_req_set_res (req , * ret , cflags );
@@ -614,7 +613,7 @@ static inline bool io_recv_finish(struct io_kiocb *req, int *ret,
614
613
615
614
io_req_set_res (req , * ret , cflags );
616
615
617
- if (req -> flags & REQ_F_POLLED )
616
+ if (issue_flags & IO_URING_F_MULTISHOT )
618
617
* ret = IOU_STOP_MULTISHOT ;
619
618
else
620
619
* ret = IOU_OK ;
@@ -773,8 +772,7 @@ int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags)
773
772
if (ret < min_ret ) {
774
773
if (ret == - EAGAIN && force_nonblock ) {
775
774
ret = io_setup_async_msg (req , kmsg , issue_flags );
776
- if (ret == - EAGAIN && (req -> flags & IO_APOLL_MULTI_POLLED ) ==
777
- IO_APOLL_MULTI_POLLED ) {
775
+ if (ret == - EAGAIN && (issue_flags & IO_URING_F_MULTISHOT )) {
778
776
io_kbuf_recycle (req , issue_flags );
779
777
return IOU_ISSUE_SKIP_COMPLETE ;
780
778
}
@@ -803,7 +801,7 @@ int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags)
803
801
if (kmsg -> msg .msg_inq )
804
802
cflags |= IORING_CQE_F_SOCK_NONEMPTY ;
805
803
806
- if (!io_recv_finish (req , & ret , cflags , mshot_finished ))
804
+ if (!io_recv_finish (req , & ret , cflags , mshot_finished , issue_flags ))
807
805
goto retry_multishot ;
808
806
809
807
if (mshot_finished ) {
@@ -869,7 +867,7 @@ int io_recv(struct io_kiocb *req, unsigned int issue_flags)
869
867
ret = sock_recvmsg (sock , & msg , flags );
870
868
if (ret < min_ret ) {
871
869
if (ret == - EAGAIN && force_nonblock ) {
872
- if (( req -> flags & IO_APOLL_MULTI_POLLED ) == IO_APOLL_MULTI_POLLED ) {
870
+ if (issue_flags & IO_URING_F_MULTISHOT ) {
873
871
io_kbuf_recycle (req , issue_flags );
874
872
return IOU_ISSUE_SKIP_COMPLETE ;
875
873
}
@@ -902,7 +900,7 @@ int io_recv(struct io_kiocb *req, unsigned int issue_flags)
902
900
if (msg .msg_inq )
903
901
cflags |= IORING_CQE_F_SOCK_NONEMPTY ;
904
902
905
- if (!io_recv_finish (req , & ret , cflags , ret <= 0 ))
903
+ if (!io_recv_finish (req , & ret , cflags , ret <= 0 , issue_flags ))
906
904
goto retry_multishot ;
907
905
908
906
return ret ;
@@ -1289,8 +1287,7 @@ int io_accept(struct io_kiocb *req, unsigned int issue_flags)
1289
1287
* return EAGAIN to arm the poll infra since it
1290
1288
* has already been done
1291
1289
*/
1292
- if ((req -> flags & IO_APOLL_MULTI_POLLED ) ==
1293
- IO_APOLL_MULTI_POLLED )
1290
+ if (issue_flags & IO_URING_F_MULTISHOT )
1294
1291
ret = IOU_ISSUE_SKIP_COMPLETE ;
1295
1292
return ret ;
1296
1293
}
@@ -1315,9 +1312,7 @@ int io_accept(struct io_kiocb *req, unsigned int issue_flags)
1315
1312
goto retry ;
1316
1313
1317
1314
io_req_set_res (req , ret , 0 );
1318
- if (req -> flags & REQ_F_POLLED )
1319
- return IOU_STOP_MULTISHOT ;
1320
- return IOU_OK ;
1315
+ return (issue_flags & IO_URING_F_MULTISHOT ) ? IOU_STOP_MULTISHOT : IOU_OK ;
1321
1316
}
1322
1317
1323
1318
int io_socket_prep (struct io_kiocb * req , const struct io_uring_sqe * sqe )
0 commit comments