From f3e769a43d02dd468a1662efc504940d8dc21eb6 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sun, 13 Jan 2019 08:56:11 -0700 Subject: [PATCH] Move io_uring to os/linux/ It's not a generic OS header, reflect the fact that it's Linux only by moving it to a linux/ directory. Also update io_uring_sqe to match current API. Signed-off-by: Jens Axboe --- Makefile | 2 +- engines/io_uring.c | 2 +- os/{ => linux}/io_uring.h | 7 ++++--- t/io_uring.c | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) rename os/{ => linux}/io_uring.h (97%) diff --git a/Makefile b/Makefile index 3701317e..fd138dd2 100644 --- a/Makefile +++ b/Makefile @@ -444,7 +444,7 @@ cairo_text_helpers.o: cairo_text_helpers.c cairo_text_helpers.h printing.o: printing.c printing.h $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $< -t/io_uring.o: os/io_uring.h +t/io_uring.o: os/linux/io_uring.h t/io_uring: $(T_IOU_RING_OBJS) $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_IOU_RING_OBJS) $(LIBS) diff --git a/engines/io_uring.c b/engines/io_uring.c index ca3e157f..2186031b 100644 --- a/engines/io_uring.c +++ b/engines/io_uring.c @@ -21,7 +21,7 @@ #ifdef ARCH_HAVE_IOURING #include "../lib/types.h" -#include "../os/io_uring.h" +#include "../os/linux/io_uring.h" struct io_sq_ring { unsigned *head; diff --git a/os/io_uring.h b/os/linux/io_uring.h similarity index 97% rename from os/io_uring.h rename to os/linux/io_uring.h index 0f4460d6..3693d125 100644 --- a/os/io_uring.h +++ b/os/linux/io_uring.h @@ -29,10 +29,11 @@ struct io_uring_sqe { __kernel_rwf_t rw_flags; __u32 fsync_flags; }; - __u16 buf_index; /* index into fixed buffers, if used */ - __u16 __pad2; - __u32 __pad3; __u64 user_data; /* data to be passed back at completion time */ + union { + __u16 buf_index; /* index into fixed buffers, if used */ + __u64 __pad2[3]; + }; }; /* diff --git a/t/io_uring.c b/t/io_uring.c index 8d3f3a9b..b10a1b2a 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -22,7 +22,7 @@ #include "../arch/arch.h" #include "../lib/types.h" -#include "../os/io_uring.h" +#include "../os/linux/io_uring.h" #define barrier() __asm__ __volatile__("": : :"memory") -- 2.25.1