Skip to content

Commit 8bb9d6c

Browse files
committed
io_uring: finish IOU_OK -> IOU_COMPLETE transition
IOU_COMPLETE is more descriptive, in that it explicitly says that the return value means "please post a completion for this request". This patch completes the transition from IOU_OK to IOU_COMPLETE, replacing existing IOU_OK users. This is a purely mechanical change. Signed-off-by: Jens Axboe <[email protected]>
1 parent f660fd2 commit 8bb9d6c

23 files changed

+46
-47
lines changed

io_uring/advise.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int io_madvise(struct io_kiocb *req, unsigned int issue_flags)
5858

5959
ret = do_madvise(current->mm, ma->addr, ma->len, ma->advice);
6060
io_req_set_res(req, ret, 0);
61-
return IOU_OK;
61+
return IOU_COMPLETE;
6262
#else
6363
return -EOPNOTSUPP;
6464
#endif
@@ -104,5 +104,5 @@ int io_fadvise(struct io_kiocb *req, unsigned int issue_flags)
104104
if (ret < 0)
105105
req_set_fail(req);
106106
io_req_set_res(req, ret, 0);
107-
return IOU_OK;
107+
return IOU_COMPLETE;
108108
}

io_uring/cancel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ int io_async_cancel(struct io_kiocb *req, unsigned int issue_flags)
229229
if (ret < 0)
230230
req_set_fail(req);
231231
io_req_set_res(req, ret, 0);
232-
return IOU_OK;
232+
return IOU_COMPLETE;
233233
}
234234

235235
static int __io_sync_cancel(struct io_uring_task *tctx,

io_uring/epoll.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ int io_epoll_ctl(struct io_kiocb *req, unsigned int issue_flags)
6161
if (ret < 0)
6262
req_set_fail(req);
6363
io_req_set_res(req, ret, 0);
64-
return IOU_OK;
64+
return IOU_COMPLETE;
6565
}
6666

6767
int io_epoll_wait_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
@@ -88,5 +88,5 @@ int io_epoll_wait(struct io_kiocb *req, unsigned int issue_flags)
8888
req_set_fail(req);
8989

9090
io_req_set_res(req, ret, 0);
91-
return IOU_OK;
91+
return IOU_COMPLETE;
9292
}

io_uring/fs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ int io_renameat(struct io_kiocb *req, unsigned int issue_flags)
9090

9191
req->flags &= ~REQ_F_NEED_CLEANUP;
9292
io_req_set_res(req, ret, 0);
93-
return IOU_OK;
93+
return IOU_COMPLETE;
9494
}
9595

9696
void io_renameat_cleanup(struct io_kiocb *req)
@@ -141,7 +141,7 @@ int io_unlinkat(struct io_kiocb *req, unsigned int issue_flags)
141141

142142
req->flags &= ~REQ_F_NEED_CLEANUP;
143143
io_req_set_res(req, ret, 0);
144-
return IOU_OK;
144+
return IOU_COMPLETE;
145145
}
146146

147147
void io_unlinkat_cleanup(struct io_kiocb *req)
@@ -185,7 +185,7 @@ int io_mkdirat(struct io_kiocb *req, unsigned int issue_flags)
185185

186186
req->flags &= ~REQ_F_NEED_CLEANUP;
187187
io_req_set_res(req, ret, 0);
188-
return IOU_OK;
188+
return IOU_COMPLETE;
189189
}
190190

191191
void io_mkdirat_cleanup(struct io_kiocb *req)
@@ -235,7 +235,7 @@ int io_symlinkat(struct io_kiocb *req, unsigned int issue_flags)
235235

236236
req->flags &= ~REQ_F_NEED_CLEANUP;
237237
io_req_set_res(req, ret, 0);
238-
return IOU_OK;
238+
return IOU_COMPLETE;
239239
}
240240

241241
int io_linkat_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
@@ -281,7 +281,7 @@ int io_linkat(struct io_kiocb *req, unsigned int issue_flags)
281281

282282
req->flags &= ~REQ_F_NEED_CLEANUP;
283283
io_req_set_res(req, ret, 0);
284-
return IOU_OK;
284+
return IOU_COMPLETE;
285285
}
286286

287287
void io_link_cleanup(struct io_kiocb *req)

io_uring/futex.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ int io_futexv_wait(struct io_kiocb *req, unsigned int issue_flags)
234234
kfree(futexv);
235235
req->async_data = NULL;
236236
req->flags &= ~REQ_F_ASYNC_DATA;
237-
return IOU_OK;
237+
return IOU_COMPLETE;
238238
}
239239

240240
/*
@@ -311,7 +311,7 @@ int io_futex_wait(struct io_kiocb *req, unsigned int issue_flags)
311311
req_set_fail(req);
312312
io_req_set_res(req, ret, 0);
313313
kfree(ifd);
314-
return IOU_OK;
314+
return IOU_COMPLETE;
315315
}
316316

317317
int io_futex_wake(struct io_kiocb *req, unsigned int issue_flags)
@@ -328,5 +328,5 @@ int io_futex_wake(struct io_kiocb *req, unsigned int issue_flags)
328328
if (ret < 0)
329329
req_set_fail(req);
330330
io_req_set_res(req, ret, 0);
331-
return IOU_OK;
331+
return IOU_COMPLETE;
332332
}

io_uring/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,7 @@ static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)
17511751

17521752
ret = __io_issue_sqe(req, issue_flags, def);
17531753

1754-
if (ret == IOU_OK) {
1754+
if (ret == IOU_COMPLETE) {
17551755
if (issue_flags & IO_URING_F_COMPLETE_DEFER)
17561756
io_req_complete_defer(req);
17571757
else

io_uring/io_uring.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#endif
2020

2121
enum {
22-
IOU_OK = 0, /* deprecated, use IOU_COMPLETE */
2322
IOU_COMPLETE = 0,
2423

2524
IOU_ISSUE_SKIP_COMPLETE = -EIOCBQUEUED,

io_uring/kbuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ int io_manage_buffers_legacy(struct io_kiocb *req, unsigned int issue_flags)
554554
if (ret < 0)
555555
req_set_fail(req);
556556
io_req_set_res(req, ret, 0);
557-
return IOU_OK;
557+
return IOU_COMPLETE;
558558
}
559559

560560
int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg)

io_uring/msg_ring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ int io_msg_ring(struct io_kiocb *req, unsigned int issue_flags)
328328
req_set_fail(req);
329329
}
330330
io_req_set_res(req, ret, 0);
331-
return IOU_OK;
331+
return IOU_COMPLETE;
332332
}
333333

334334
int io_uring_sync_msg_ring(struct io_uring_sqe *sqe)

io_uring/net.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ int io_shutdown(struct io_kiocb *req, unsigned int issue_flags)
128128

129129
ret = __sys_shutdown_sock(sock, shutdown->how);
130130
io_req_set_res(req, ret, 0);
131-
return IOU_OK;
131+
return IOU_COMPLETE;
132132
}
133133

134134
static bool io_net_retry(struct socket *sock, int flags)
@@ -502,7 +502,7 @@ static inline bool io_send_finish(struct io_kiocb *req, int *ret,
502502
/* Otherwise stop bundle and use the current result. */
503503
finish:
504504
io_req_set_res(req, *ret, cflags);
505-
*ret = IOU_OK;
505+
*ret = IOU_COMPLETE;
506506
return true;
507507
}
508508

@@ -553,7 +553,7 @@ int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags)
553553
else if (sr->done_io)
554554
ret = sr->done_io;
555555
io_req_set_res(req, ret, 0);
556-
return IOU_OK;
556+
return IOU_COMPLETE;
557557
}
558558

559559
static int io_send_select_buffer(struct io_kiocb *req, unsigned int issue_flags,
@@ -1459,7 +1459,7 @@ int io_send_zc(struct io_kiocb *req, unsigned int issue_flags)
14591459
io_req_msg_cleanup(req, 0);
14601460
}
14611461
io_req_set_res(req, ret, IORING_CQE_F_MORE);
1462-
return IOU_OK;
1462+
return IOU_COMPLETE;
14631463
}
14641464

14651465
int io_sendmsg_zc(struct io_kiocb *req, unsigned int issue_flags)
@@ -1530,7 +1530,7 @@ int io_sendmsg_zc(struct io_kiocb *req, unsigned int issue_flags)
15301530
io_req_msg_cleanup(req, 0);
15311531
}
15321532
io_req_set_res(req, ret, IORING_CQE_F_MORE);
1533-
return IOU_OK;
1533+
return IOU_COMPLETE;
15341534
}
15351535

15361536
void io_sendrecv_fail(struct io_kiocb *req)
@@ -1694,7 +1694,7 @@ int io_socket(struct io_kiocb *req, unsigned int issue_flags)
16941694
sock->file_slot);
16951695
}
16961696
io_req_set_res(req, ret, 0);
1697-
return IOU_OK;
1697+
return IOU_COMPLETE;
16981698
}
16991699

17001700
int io_connect_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
@@ -1761,7 +1761,7 @@ int io_connect(struct io_kiocb *req, unsigned int issue_flags)
17611761
req_set_fail(req);
17621762
io_req_msg_cleanup(req, issue_flags);
17631763
io_req_set_res(req, ret, 0);
1764-
return IOU_OK;
1764+
return IOU_COMPLETE;
17651765
}
17661766

17671767
int io_bind_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)

0 commit comments

Comments
 (0)