File tree Expand file tree Collapse file tree 1 file changed +6
-19
lines changed Expand file tree Collapse file tree 1 file changed +6
-19
lines changed Original file line number Diff line number Diff line change @@ -182,18 +182,12 @@ static int io_uring_cmd_prep_setup(struct io_kiocb *req,
182182 struct uring_cache * cache ;
183183
184184 cache = io_uring_async_get (req );
185- if (unlikely (!cache ))
186- return - ENOMEM ;
187-
188- if (!(req -> flags & REQ_F_FORCE_ASYNC )) {
189- /* defer memcpy until we need it */
190- ioucmd -> sqe = sqe ;
185+ if (cache ) {
186+ memcpy (cache -> sqes , sqe , uring_sqe_size (req -> ctx ));
187+ ioucmd -> sqe = req -> async_data ;
191188 return 0 ;
192189 }
193-
194- memcpy (req -> async_data , sqe , uring_sqe_size (req -> ctx ));
195- ioucmd -> sqe = req -> async_data ;
196- return 0 ;
190+ return - ENOMEM ;
197191}
198192
199193int io_uring_cmd_prep (struct io_kiocb * req , const struct io_uring_sqe * sqe )
@@ -251,15 +245,8 @@ int io_uring_cmd(struct io_kiocb *req, unsigned int issue_flags)
251245 }
252246
253247 ret = file -> f_op -> uring_cmd (ioucmd , issue_flags );
254- if (ret == - EAGAIN ) {
255- struct uring_cache * cache = req -> async_data ;
256-
257- if (ioucmd -> sqe != (void * ) cache )
258- memcpy (cache , ioucmd -> sqe , uring_sqe_size (req -> ctx ));
259- return - EAGAIN ;
260- } else if (ret == - EIOCBQUEUED ) {
261- return - EIOCBQUEUED ;
262- }
248+ if (ret == - EAGAIN || ret == - EIOCBQUEUED )
249+ return ret ;
263250
264251 if (ret < 0 )
265252 req_set_fail (req );
You can’t perform that action at this time.
0 commit comments