qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org, stefanha@redhat.com
Subject: [PATCH] io_uring: move LuringState typedef to block/aio.h
Date: Mon, 12 Jul 2021 15:10:30 +0200	[thread overview]
Message-ID: <20210712131030.465621-1-pbonzini@redhat.com> (raw)

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



             reply	other threads:[~2021-07-12 13:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12 13:10 Paolo Bonzini [this message]
2021-07-12 13:38 ` [PATCH] io_uring: move LuringState typedef to block/aio.h Stefan Hajnoczi
2021-07-12 14:13 ` Philippe Mathieu-Daudé
2021-07-12 14:54 ` Pankaj Gupta
2021-07-20  8:29 ` Stefano Garzarella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210712131030.465621-1-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).