Skip to content

Commit

Permalink
io_uring: move a few private types to local headers
Browse files Browse the repository at this point in the history
Commit 3a3d47f ("io_uring: make io_uring_types.h public") moved
a bunch of io_uring types to a kernel wide header, so we could make
tracing a bit saner rather than pass in a ton of arguments.

However, there are a few types in there that are not really needed to
be system wide. Move the cancel data and mapped buffers back to the
appropriate io_uring local headers.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Jul 25, 2022
1 parent 48863ff commit ad163a7
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
18 changes: 0 additions & 18 deletions include/linux/io_uring_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,27 +528,9 @@ struct io_kiocb {
struct io_wq_work work;
};

struct io_cancel_data {
struct io_ring_ctx *ctx;
union {
u64 data;
struct file *file;
};
u32 flags;
int seq;
};

struct io_overflow_cqe {
struct list_head list;
struct io_uring_cqe cqe;
};

struct io_mapped_ubuf {
u64 ubuf;
u64 ubuf_end;
unsigned int nr_bvecs;
unsigned long acct_pages;
struct bio_vec bvec[];
};

#endif
13 changes: 13 additions & 0 deletions io_uring/cancel.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
// SPDX-License-Identifier: GPL-2.0

#include <linux/io_uring_types.h>

struct io_cancel_data {
struct io_ring_ctx *ctx;
union {
u64 data;
struct file *file;
};
u32 flags;
int seq;
};


int io_async_cancel_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
int io_async_cancel(struct io_kiocb *req, unsigned int issue_flags);

Expand Down
1 change: 1 addition & 0 deletions io_uring/fdinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "sqpoll.h"
#include "fdinfo.h"
#include "cancel.h"
#include "rsrc.h"

#ifdef CONFIG_PROC_FS
static __cold int io_uring_show_cred(struct seq_file *m, unsigned int id,
Expand Down
1 change: 1 addition & 0 deletions io_uring/poll.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ int io_poll_add(struct io_kiocb *req, unsigned int issue_flags);
int io_poll_remove_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
int io_poll_remove(struct io_kiocb *req, unsigned int issue_flags);

struct io_cancel_data;
int io_poll_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd,
unsigned issue_flags);
int io_arm_poll_handler(struct io_kiocb *req, unsigned issue_flags);
Expand Down
8 changes: 8 additions & 0 deletions io_uring/rsrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ struct io_rsrc_node {
bool done;
};

struct io_mapped_ubuf {
u64 ubuf;
u64 ubuf_end;
unsigned int nr_bvecs;
unsigned long acct_pages;
struct bio_vec bvec[];
};

void io_rsrc_put_work(struct work_struct *work);
void io_rsrc_refs_refill(struct io_ring_ctx *ctx);
void io_wait_rsrc_data(struct io_rsrc_data *data);
Expand Down
1 change: 1 addition & 0 deletions io_uring/timeout.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static inline struct io_kiocb *io_disarm_linked_timeout(struct io_kiocb *req)
}

__cold void io_flush_timeouts(struct io_ring_ctx *ctx);
struct io_cancel_data;
int io_timeout_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd);
__cold bool io_kill_timeouts(struct io_ring_ctx *ctx, struct task_struct *tsk,
bool cancel_all);
Expand Down

0 comments on commit ad163a7

Please sign in to comment.