File tree Expand file tree Collapse file tree 3 files changed +18
-9
lines changed Expand file tree Collapse file tree 3 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ const struct io_issue_def io_issue_defs[] = {
66
66
.iopoll = 1 ,
67
67
.iopoll_queue = 1 ,
68
68
.vectored = 1 ,
69
- .prep = io_prep_rw ,
69
+ .prep = io_prep_rwv ,
70
70
.issue = io_read ,
71
71
},
72
72
[IORING_OP_WRITEV ] = {
@@ -80,7 +80,7 @@ const struct io_issue_def io_issue_defs[] = {
80
80
.iopoll = 1 ,
81
81
.iopoll_queue = 1 ,
82
82
.vectored = 1 ,
83
- .prep = io_prep_rw ,
83
+ .prep = io_prep_rwv ,
84
84
.issue = io_write ,
85
85
},
86
86
[IORING_OP_FSYNC ] = {
Original file line number Diff line number Diff line change @@ -110,15 +110,23 @@ int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe)
110
110
rw -> addr = READ_ONCE (sqe -> addr );
111
111
rw -> len = READ_ONCE (sqe -> len );
112
112
rw -> flags = READ_ONCE (sqe -> rw_flags );
113
+ return 0 ;
114
+ }
113
115
114
- /* Have to do this validation here, as this is in io_read() rw->len might
115
- * have chanaged due to buffer selection
116
+ int io_prep_rwv (struct io_kiocb * req , const struct io_uring_sqe * sqe )
117
+ {
118
+ int ret ;
119
+
120
+ ret = io_prep_rw (req , sqe );
121
+ if (unlikely (ret ))
122
+ return ret ;
123
+
124
+ /*
125
+ * Have to do this validation here, as this is in io_read() rw->len
126
+ * might have chanaged due to buffer selection
116
127
*/
117
- if (req -> opcode == IORING_OP_READV && req -> flags & REQ_F_BUFFER_SELECT ) {
118
- ret = io_iov_buffer_select_prep (req );
119
- if (ret )
120
- return ret ;
121
- }
128
+ if (req -> flags & REQ_F_BUFFER_SELECT )
129
+ return io_iov_buffer_select_prep (req );
122
130
123
131
return 0 ;
124
132
}
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ struct io_async_rw {
16
16
};
17
17
18
18
int io_prep_rw (struct io_kiocb * req , const struct io_uring_sqe * sqe );
19
+ int io_prep_rwv (struct io_kiocb * req , const struct io_uring_sqe * sqe );
19
20
int io_read (struct io_kiocb * req , unsigned int issue_flags );
20
21
int io_readv_prep_async (struct io_kiocb * req );
21
22
int io_write (struct io_kiocb * req , unsigned int issue_flags );
You can’t perform that action at this time.
0 commit comments