Skip to content

Commit

Permalink
io_uring: make io_uring_types.h public
Browse files Browse the repository at this point in the history
Move io_uring types to linux/include, need them public so tracing can
see the definitions and we can clean trace/events/io_uring.h

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/a15f12e8cb7289b2de0deaddcc7518d98a132d17.1655384063.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
isilence authored and axboe committed Jul 25, 2022
1 parent 27a9d66 commit ab1c84d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
28 changes: 26 additions & 2 deletions io_uring/io_uring_types.h → include/linux/io_uring_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,32 @@
#include <linux/bitmap.h>
#include <uapi/linux/io_uring.h>

#include "io-wq.h"
#include "filetable.h"
struct io_wq_work_node {
struct io_wq_work_node *next;
};

struct io_wq_work_list {
struct io_wq_work_node *first;
struct io_wq_work_node *last;
};

struct io_wq_work {
struct io_wq_work_node list;
unsigned flags;
/* place it here instead of io_kiocb as it fills padding and saves 4B */
int cancel_seq;
};

struct io_fixed_file {
/* file * with additional FFS_* flags */
unsigned long file_ptr;
};

struct io_file_table {
struct io_fixed_file *files;
unsigned long *bitmap;
unsigned int alloc_hint;
};

struct io_hash_bucket {
spinlock_t lock;
Expand Down
11 changes: 0 additions & 11 deletions io_uring/filetable.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ struct io_kiocb;
#endif
#define FFS_MASK ~(FFS_NOWAIT|FFS_ISREG|FFS_SCM)

struct io_fixed_file {
/* file * with additional FFS_* flags */
unsigned long file_ptr;
};

struct io_file_table {
struct io_fixed_file *files;
unsigned long *bitmap;
unsigned int alloc_hint;
};

bool io_alloc_file_tables(struct io_file_table *table, unsigned nr_files);
void io_free_file_tables(struct io_file_table *table);

Expand Down
17 changes: 1 addition & 16 deletions io_uring/io-wq.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define INTERNAL_IO_WQ_H

#include <linux/refcount.h>
#include <linux/io_uring_types.h>

struct io_wq;

Expand All @@ -20,15 +21,6 @@ enum io_wq_cancel {
IO_WQ_CANCEL_NOTFOUND, /* work not found */
};

struct io_wq_work_node {
struct io_wq_work_node *next;
};

struct io_wq_work_list {
struct io_wq_work_node *first;
struct io_wq_work_node *last;
};

#define wq_list_for_each(pos, prv, head) \
for (pos = (head)->first, prv = NULL; pos; prv = pos, pos = (pos)->next)

Expand Down Expand Up @@ -152,13 +144,6 @@ struct io_wq_work_node *wq_stack_extract(struct io_wq_work_node *stack)
return node;
}

struct io_wq_work {
struct io_wq_work_node list;
unsigned flags;
/* place it here instead of io_kiocb as it fills padding and saves 4B */
int cancel_seq;
};

static inline struct io_wq_work *wq_next_work(struct io_wq_work *work)
{
if (!work->list.next)
Expand Down
4 changes: 3 additions & 1 deletion io_uring/io_uring.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

#include <linux/errno.h>
#include <linux/lockdep.h>
#include "io_uring_types.h"
#include <linux/io_uring_types.h>
#include "io-wq.h"
#include "filetable.h"

#ifndef CREATE_TRACE_POINTS
#include <trace/events/io_uring.h>
Expand Down
2 changes: 1 addition & 1 deletion io_uring/refs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define IOU_REQ_REF_H

#include <linux/atomic.h>
#include "io_uring_types.h"
#include <linux/io_uring_types.h>

/*
* Shamelessly stolen from the mm implementation of page reference checking,
Expand Down

0 comments on commit ab1c84d

Please sign in to comment.