@@ -767,6 +767,12 @@ struct io_msg {
767767 u32 len ;
768768};
769769
770+ struct io_nop {
771+ struct file * file ;
772+ u64 extra1 ;
773+ u64 extra2 ;
774+ };
775+
770776struct io_async_connect {
771777 struct sockaddr_storage address ;
772778};
@@ -965,6 +971,7 @@ struct io_kiocb {
965971 struct io_msg msg ;
966972 struct io_xattr xattr ;
967973 struct io_socket sock ;
974+ struct io_nop nop ;
968975 };
969976
970977 u8 opcode ;
@@ -5040,12 +5047,29 @@ static int io_splice(struct io_kiocb *req, unsigned int issue_flags)
50405047 return 0 ;
50415048}
50425049
5050+ static int io_nop_prep (struct io_kiocb * req , const struct io_uring_sqe * sqe )
5051+ {
5052+ /*
5053+ * If the ring is setup with CQE32, relay back addr/addr
5054+ */
5055+ if (req -> ctx -> flags & IORING_SETUP_CQE32 ) {
5056+ req -> nop .extra1 = READ_ONCE (sqe -> addr );
5057+ req -> nop .extra2 = READ_ONCE (sqe -> addr2 );
5058+ }
5059+
5060+ return 0 ;
5061+ }
5062+
50435063/*
50445064 * IORING_OP_NOP just posts a completion event, nothing else.
50455065 */
50465066static int io_nop (struct io_kiocb * req , unsigned int issue_flags )
50475067{
5048- __io_req_complete (req , issue_flags , 0 , 0 );
5068+ if (!(req -> ctx -> flags & IORING_SETUP_CQE32 ))
5069+ __io_req_complete (req , issue_flags , 0 , 0 );
5070+ else
5071+ __io_req_complete32 (req , issue_flags , 0 , 0 , req -> nop .extra1 ,
5072+ req -> nop .extra2 );
50495073 return 0 ;
50505074}
50515075
@@ -7647,7 +7671,7 @@ static int io_req_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
76477671{
76487672 switch (req -> opcode ) {
76497673 case IORING_OP_NOP :
7650- return 0 ;
7674+ return io_nop_prep ( req , sqe ) ;
76517675 case IORING_OP_READV :
76527676 case IORING_OP_READ_FIXED :
76537677 case IORING_OP_READ :
0 commit comments