io_uring: move LuringState typedef to block/aio.h
PATCH 1/1 io_uring: move LuringState typedef to block/aio.h
The LuringState typedef is defined twice, in include/block/raw-aio.h and block/io_uring.c. Move it in include/block/aio.h, which is included everywhere the typedef is needed, since include/block/aio.h already has to define the forward reference to the struct.
--- block/io_uring.c | 4 ++-- include/block/aio.h | 8 ++++---- include/block/raw-aio.h | 1 - 3 files changed, 6 insertions(+), 7 deletions(-)
block/io_uring.c +2 -2
@@ -46,7 +46,7 @@ typedef struct LuringQueue { QSIMPLEQ_HEAD(, LuringAIOCB) submit_queue; } LuringQueue; -typedef struct LuringState { +struct LuringState {AioContext *aio_context;struct io_uring ring;
@@ -56,7 +56,7 @@ typedef struct LuringState {/* I/O completion processing. Only runs in I/O thread. */ QEMUBH *completion_bh; -} LuringState; +};/** * luring_resubmit:
include/block/aio.h +4 -4
@@ -54,7 +54,7 @@ typedef void IOHandler(void *opaque);struct Coroutine ;struct ThreadPool ;struct LinuxAioState ; -struct LuringState ; +typedef struct LuringState LuringState ;/* Is polling disabled? */ bool aio_poll_disabled (AioContext *ctx);
@@ -209,7 +209,7 @@ struct AioContext {* State for Linux io_uring. Uses aio_context_acquire/release for * locking. */ -struct LuringState *linux_io_uring; +LuringState *linux_io_uring;/* State for file descriptor monitoring using Linux io_uring */ struct io_uring fdmon_io_uring;
@@ -513,10 +513,10 @@ struct LinuxAioState *aio_setup_linux_aio(AioContext *ctx, Error **errp);struct LinuxAioState *aio_get_linux_aio (AioContext *ctx);/* Setup the LuringState bound to this AioContext */ -struct LuringState *aio_setup_linux_io_uring (AioContext *ctx,Error **errp); +LuringState *aio_setup_linux_io_uring (AioContext *ctx,Error **errp);/* Return the LuringState bound to this AioContext */ -struct LuringState *aio_get_linux_io_uring (AioContext *ctx); +LuringState *aio_get_linux_io_uring (AioContext *ctx);/** * aio_timer_new_with_attrs: * @ctx: the aio context
include/block/raw-aio.h +0 -1
@@ -59,7 +59,6 @@ void laio_io_unplug(BlockDriverState *bs, LinuxAioState *s);#endif /* io_uring.c - Linux io_uring implementation */ #ifdef CONFIG_LINUX_IO_URING -typedef struct LuringState LuringState ;LuringState *luring_init (Error **errp);void luring_cleanup (LuringState *s); int coroutine_fn luring_co_submit(BlockDriverState *bs, LuringState *s, int fd,
Signature · 1 line
2.31.1
Quoted 11 lines · Paolo Bonzini
The LuringState typedef is defined twice, in
include/block/raw-aio.handblock/io_uring.c. Move it ininclude/block/aio.h, which is included everywhere the typedef is needed, sinceinclude/block/aio.halready has to define the forward reference to the struct.Signed-off-by Paolo Bonzini <[email protected]>--- block/io_uring.c | 4 ++-- include/block/aio.h | 8 ++++---- include/block/raw-aio.h | 1 - 3 files changed, 6 insertions(+), 7 deletions(-)
Quoted 11 lines · Paolo Bonzini
The LuringState typedef is defined twice, in
include/block/raw-aio.handblock/io_uring.c. Move it ininclude/block/aio.h, which is included everywhere the typedef is needed, sinceinclude/block/aio.halready has to define the forward reference to the struct.Signed-off-by Paolo Bonzini <[email protected]>--- block/io_uring.c | 4 ++-- include/block/aio.h | 8 ++++---- include/block/raw-aio.h | 1 - 3 files changed, 6 insertions(+), 7 deletions(-)
Quoted 74 lines
The LuringState typedef is defined twice, in
include/block/raw-aio.handblock/io_uring.c. Move it ininclude/block/aio.h, which is included everywhere the typedef is needed, sinceinclude/block/aio.halready has to define the forward reference to the struct.Signed-off-by Paolo Bonzini <[email protected]>--- block/io_uring.c | 4 ++-- include/block/aio.h | 8 ++++---- include/block/raw-aio.h | 1 - 3 files changed, 6 insertions(+), 7 deletions(-)block/io_uring.c +2
-2@@ -46,7 +46,7 @@ typedef struct LuringQueue { QSIMPLEQ_HEAD(, LuringAIOCB) submit_queue; } LuringQueue; -typedef struct LuringState { +struct LuringState {AioContext *aio_context;struct io_uring ring;@@ -56,7 +56,7 @@ typedef struct LuringState {/* I/O completion processing. Only runs in I/O thread. */ QEMUBH *completion_bh; -} LuringState; +};/** * luring_resubmit: include/block/aio.h +4
-4@@ -54,7 +54,7 @@ typedef void IOHandler(void *opaque);struct Coroutine ;struct ThreadPool ;struct LinuxAioState ; -struct LuringState ; +typedef struct LuringState LuringState ;/* Is polling disabled? */ bool aio_poll_disabled (AioContext *ctx);@@ -209,7 +209,7 @@ struct AioContext {* State for Linux io_uring. Uses aio_context_acquire/release for * locking. */ -struct LuringState *linux_io_uring; +LuringState *linux_io_uring;/* State for file descriptor monitoring using Linux io_uring */ struct io_uring fdmon_io_uring;@@ -513,10 +513,10 @@ struct LinuxAioState *aio_setup_linux_aio(AioContext *ctx, Error **errp);struct LinuxAioState *aio_get_linux_aio (AioContext *ctx);/* Setup the LuringState bound to this AioContext */ -struct LuringState *aio_setup_linux_io_uring (AioContext *ctx,Error **errp); +LuringState *aio_setup_linux_io_uring (AioContext *ctx,Error **errp);/* Return the LuringState bound to this AioContext */ -struct LuringState *aio_get_linux_io_uring (AioContext *ctx); +LuringState *aio_get_linux_io_uring (AioContext *ctx);/** * aio_timer_new_with_attrs: * @ctx: the aio context include/block/raw-aio.h +0
-0
include/block/raw-aio.h void laio_io_unplug(BlockDriverState *bs, LinuxAioState *s);
Quoted 8 lines
include/block/raw-aio.h +0
-2@@ -59,7 +59,6 @@ void laio_io_unplug(BlockDriverState *bs, LinuxAioState *s);#endif /* io_uring.c - Linux io_uring implementation */ #ifdef CONFIG_LINUX_IO_URING -typedef struct LuringState LuringState ;LuringState *luring_init (Error **errp);void luring_cleanup (LuringState *s); int coroutine_fn luring_co_submit(BlockDriverState *bs, LuringState *s, int fd, --
Quoted 11 lines · Paolo Bonzini
The LuringState typedef is defined twice, in
include/block/raw-aio.handblock/io_uring.c. Move it ininclude/block/aio.h, which is included everywhere the typedef is needed, sinceinclude/block/aio.halready has to define the forward reference to the struct.Signed-off-by Paolo Bonzini <[email protected]>---
block/io_uring.c | 4 ++-- include/block/aio.h | 8 ++++---- include/block/raw-aio.h | 1 - 3 files changed, 6 insertions(+), 7 deletions(-)