Skip to content

Commit d9808ce

Browse files
isilenceaxboe
authored andcommitted
Revert "io_uring: rename IORING_OP_FILES_UPDATE"
This reverts commit 4379d5f. We removed notification flushing, also cleanup uapi preparation changes to not pollute it. Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/89edc3905350f91e1b6e26d9dbf42ee44fd451a2.1662027856.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 23c12d5 commit d9808ce

File tree

4 files changed

+9
-33
lines changed

4 files changed

+9
-33
lines changed

include/uapi/linux/io_uring.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ enum io_uring_op {
178178
IORING_OP_FALLOCATE,
179179
IORING_OP_OPENAT,
180180
IORING_OP_CLOSE,
181-
IORING_OP_RSRC_UPDATE,
182-
IORING_OP_FILES_UPDATE = IORING_OP_RSRC_UPDATE,
181+
IORING_OP_FILES_UPDATE,
183182
IORING_OP_STATX,
184183
IORING_OP_READ,
185184
IORING_OP_WRITE,
@@ -228,7 +227,6 @@ enum io_uring_op {
228227
#define IORING_TIMEOUT_ETIME_SUCCESS (1U << 5)
229228
#define IORING_TIMEOUT_CLOCK_MASK (IORING_TIMEOUT_BOOTTIME | IORING_TIMEOUT_REALTIME)
230229
#define IORING_TIMEOUT_UPDATE_MASK (IORING_TIMEOUT_UPDATE | IORING_LINK_TIMEOUT_UPDATE)
231-
232230
/*
233231
* sqe->splice_flags
234232
* extends splice(2) flags
@@ -295,14 +293,6 @@ enum io_uring_op {
295293
*/
296294
#define IORING_ACCEPT_MULTISHOT (1U << 0)
297295

298-
299-
/*
300-
* IORING_OP_RSRC_UPDATE flags
301-
*/
302-
enum {
303-
IORING_RSRC_UPDATE_FILES,
304-
};
305-
306296
/*
307297
* IORING_OP_MSG_RING command types, stored in sqe->addr
308298
*/

io_uring/opdef.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,12 @@ const struct io_op_def io_op_defs[] = {
246246
.prep = io_close_prep,
247247
.issue = io_close,
248248
},
249-
[IORING_OP_RSRC_UPDATE] = {
249+
[IORING_OP_FILES_UPDATE] = {
250250
.audit_skip = 1,
251251
.iopoll = 1,
252-
.name = "RSRC_UPDATE",
253-
.prep = io_rsrc_update_prep,
254-
.issue = io_rsrc_update,
255-
.ioprio = 1,
252+
.name = "FILES_UPDATE",
253+
.prep = io_files_update_prep,
254+
.issue = io_files_update,
256255
},
257256
[IORING_OP_STATX] = {
258257
.audit_skip = 1,

io_uring/rsrc.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ struct io_rsrc_update {
2121
u64 arg;
2222
u32 nr_args;
2323
u32 offset;
24-
int type;
2524
};
2625

2726
static int io_sqe_buffer_register(struct io_ring_ctx *ctx, struct iovec *iov,
@@ -654,7 +653,7 @@ __cold int io_register_rsrc(struct io_ring_ctx *ctx, void __user *arg,
654653
return -EINVAL;
655654
}
656655

657-
int io_rsrc_update_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
656+
int io_files_update_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
658657
{
659658
struct io_rsrc_update *up = io_kiocb_to_cmd(req, struct io_rsrc_update);
660659

@@ -668,7 +667,6 @@ int io_rsrc_update_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
668667
if (!up->nr_args)
669668
return -EINVAL;
670669
up->arg = READ_ONCE(sqe->addr);
671-
up->type = READ_ONCE(sqe->ioprio);
672670
return 0;
673671
}
674672

@@ -711,7 +709,7 @@ static int io_files_update_with_index_alloc(struct io_kiocb *req,
711709
return ret;
712710
}
713711

714-
static int io_files_update(struct io_kiocb *req, unsigned int issue_flags)
712+
int io_files_update(struct io_kiocb *req, unsigned int issue_flags)
715713
{
716714
struct io_rsrc_update *up = io_kiocb_to_cmd(req, struct io_rsrc_update);
717715
struct io_ring_ctx *ctx = req->ctx;
@@ -740,17 +738,6 @@ static int io_files_update(struct io_kiocb *req, unsigned int issue_flags)
740738
return IOU_OK;
741739
}
742740

743-
int io_rsrc_update(struct io_kiocb *req, unsigned int issue_flags)
744-
{
745-
struct io_rsrc_update *up = io_kiocb_to_cmd(req, struct io_rsrc_update);
746-
747-
switch (up->type) {
748-
case IORING_RSRC_UPDATE_FILES:
749-
return io_files_update(req, issue_flags);
750-
}
751-
return -EINVAL;
752-
}
753-
754741
int io_queue_rsrc_removal(struct io_rsrc_data *data, unsigned idx,
755742
struct io_rsrc_node *node, void *rsrc)
756743
{

io_uring/rsrc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ static inline u64 *io_get_tag_slot(struct io_rsrc_data *data, unsigned int idx)
167167
return &data->tags[table_idx][off];
168168
}
169169

170-
int io_rsrc_update(struct io_kiocb *req, unsigned int issue_flags);
171-
int io_rsrc_update_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
170+
int io_files_update(struct io_kiocb *req, unsigned int issue_flags);
171+
int io_files_update_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
172172

173173
int __io_account_mem(struct user_struct *user, unsigned long nr_pages);
174174

0 commit comments

Comments
 (0)