@@ -767,6 +767,12 @@ struct io_msg {
767
767
u32 len ;
768
768
};
769
769
770
+ struct io_nop {
771
+ struct file * file ;
772
+ u64 extra1 ;
773
+ u64 extra2 ;
774
+ };
775
+
770
776
struct io_async_connect {
771
777
struct sockaddr_storage address ;
772
778
};
@@ -965,6 +971,7 @@ struct io_kiocb {
965
971
struct io_msg msg ;
966
972
struct io_xattr xattr ;
967
973
struct io_socket sock ;
974
+ struct io_nop nop ;
968
975
};
969
976
970
977
u8 opcode ;
@@ -5040,12 +5047,29 @@ static int io_splice(struct io_kiocb *req, unsigned int issue_flags)
5040
5047
return 0 ;
5041
5048
}
5042
5049
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
+
5043
5063
/*
5044
5064
* IORING_OP_NOP just posts a completion event, nothing else.
5045
5065
*/
5046
5066
static int io_nop (struct io_kiocb * req , unsigned int issue_flags )
5047
5067
{
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 );
5049
5073
return 0 ;
5050
5074
}
5051
5075
@@ -7647,7 +7671,7 @@ static int io_req_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
7647
7671
{
7648
7672
switch (req -> opcode ) {
7649
7673
case IORING_OP_NOP :
7650
- return 0 ;
7674
+ return io_nop_prep ( req , sqe ) ;
7651
7675
case IORING_OP_READV :
7652
7676
case IORING_OP_READ_FIXED :
7653
7677
case IORING_OP_READ :
0 commit comments