All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] io_uring: move LuringState typedef to block/aio.h
@ 2021-07-12 13:10 Paolo Bonzini
  2021-07-12 13:38 ` Stefan Hajnoczi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Paolo Bonzini @ 2021-07-12 13:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee, stefanha

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.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block/io_uring.c        | 4 ++--
 include/block/aio.h     | 8 ++++----
 include/block/raw-aio.h | 1 -
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/block/io_uring.c b/block/io_uring.c
index 00a3ee9fb8..aa856a4c5d 100644
--- a/block/io_uring.c
+++ b/block/io_uring.c
@@ -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:
diff --git a/include/block/aio.h b/include/block/aio.h
index 807edce9b5..8e2e4fe10f 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -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
diff --git a/include/block/raw-aio.h b/include/block/raw-aio.h
index 251b10d273..af0ea0fba4 100644
--- a/include/block/raw-aio.h
+++ b/include/block/raw-aio.h
@@ -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,
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] io_uring: move LuringState typedef to block/aio.h
  2021-07-12 13:10 [PATCH] io_uring: move LuringState typedef to block/aio.h Paolo Bonzini
@ 2021-07-12 13:38 ` Stefan Hajnoczi
  2021-07-12 14:13 ` Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2021-07-12 13:38 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: alex.bennee, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 621 bytes --]

On Mon, Jul 12, 2021 at 03:10:30PM +0200, Paolo Bonzini wrote:
> 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.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  block/io_uring.c        | 4 ++--
>  include/block/aio.h     | 8 ++++----
>  include/block/raw-aio.h | 1 -
>  3 files changed, 6 insertions(+), 7 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] io_uring: move LuringState typedef to block/aio.h
  2021-07-12 13:10 [PATCH] io_uring: move LuringState typedef to block/aio.h Paolo Bonzini
  2021-07-12 13:38 ` Stefan Hajnoczi
@ 2021-07-12 14:13 ` Philippe Mathieu-Daudé
  2021-07-12 14:54 ` Pankaj Gupta
  2021-07-20  8:29 ` Stefano Garzarella
  3 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-07-12 14:13 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: alex.bennee, stefanha

On 7/12/21 3:10 PM, Paolo Bonzini wrote:
> 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.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  block/io_uring.c        | 4 ++--
>  include/block/aio.h     | 8 ++++----
>  include/block/raw-aio.h | 1 -
>  3 files changed, 6 insertions(+), 7 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] io_uring: move LuringState typedef to block/aio.h
  2021-07-12 13:10 [PATCH] io_uring: move LuringState typedef to block/aio.h Paolo Bonzini
  2021-07-12 13:38 ` Stefan Hajnoczi
  2021-07-12 14:13 ` Philippe Mathieu-Daudé
@ 2021-07-12 14:54 ` Pankaj Gupta
  2021-07-20  8:29 ` Stefano Garzarella
  3 siblings, 0 replies; 5+ messages in thread
From: Pankaj Gupta @ 2021-07-12 14:54 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: alex.bennee, Qemu Developers, Stefan Hajnoczi

> 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.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  block/io_uring.c        | 4 ++--
>  include/block/aio.h     | 8 ++++----
>  include/block/raw-aio.h | 1 -
>  3 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/block/io_uring.c b/block/io_uring.c
> index 00a3ee9fb8..aa856a4c5d 100644
> --- a/block/io_uring.c
> +++ b/block/io_uring.c
> @@ -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:
> diff --git a/include/block/aio.h b/include/block/aio.h
> index 807edce9b5..8e2e4fe10f 100644
> --- a/include/block/aio.h
> +++ b/include/block/aio.h
> @@ -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
> diff --git a/include/block/raw-aio.h b/include/block/raw-aio.h
> index 251b10d273..af0ea0fba4 100644
> --- a/include/block/raw-aio.h
> +++ b/include/block/raw-aio.h
> @@ -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,
> --

Reviewed-by: Pankaj Gupta <pankaj.gupta@ionos.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] io_uring: move LuringState typedef to block/aio.h
  2021-07-12 13:10 [PATCH] io_uring: move LuringState typedef to block/aio.h Paolo Bonzini
                   ` (2 preceding siblings ...)
  2021-07-12 14:54 ` Pankaj Gupta
@ 2021-07-20  8:29 ` Stefano Garzarella
  3 siblings, 0 replies; 5+ messages in thread
From: Stefano Garzarella @ 2021-07-20  8:29 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: alex.bennee, qemu-devel, stefanha

On Mon, Jul 12, 2021 at 03:10:30PM +0200, Paolo Bonzini wrote:
>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.
>
>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>---
> block/io_uring.c        | 4 ++--
> include/block/aio.h     | 8 ++++----
> include/block/raw-aio.h | 1 -
> 3 files changed, 6 insertions(+), 7 deletions(-)

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-20  8:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-12 13:10 [PATCH] io_uring: move LuringState typedef to block/aio.h Paolo Bonzini
2021-07-12 13:38 ` Stefan Hajnoczi
2021-07-12 14:13 ` Philippe Mathieu-Daudé
2021-07-12 14:54 ` Pankaj Gupta
2021-07-20  8:29 ` Stefano Garzarella

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.