All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] Use io_ring_register_ring_fd() to skip fd operations
@ 2022-04-18  9:05 Sam Li
  2022-04-18 22:24 ` Damien Le Moal
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Li @ 2022-04-18  9:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: Dmitry Fomichev, Stefan Hajnoczi, Damien Le Moal, Sam Li,
	Hannes Reinecke

fix code style issue.

Signed-off-by: Sam Li <faithilikerun@gmail.com>
---
 block/io_uring.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/block/io_uring.c b/block/io_uring.c
index 2942967126..57745ecfa1 100644
--- a/block/io_uring.c
+++ b/block/io_uring.c
@@ -436,10 +436,15 @@ LuringState *luring_init(Error **errp)
 
     ioq_init(&s->io_q);
     if (io_uring_register_ring_fd(&s->ring) < 0) {
-        error_setg_errno(errp, errno, "failed to register linux io_uring ring file descriptor");
+        /*
+         * If the function fails, it will fallback to the non-optimized io_uring
+         * operations.
+         */
+        error_setg_errno(errp, errno,
+                         "failed to register linux io_uring ring file descriptor");
     }
-    return s;
 
+    return s;
 }
 
 void luring_cleanup(LuringState *s)
-- 
2.35.1



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

* Re: [PATCH 2/2] Use io_ring_register_ring_fd() to skip fd operations
  2022-04-18  9:05 [PATCH 2/2] Use io_ring_register_ring_fd() to skip fd operations Sam Li
@ 2022-04-18 22:24 ` Damien Le Moal
  2022-04-18 23:36   ` olc
  0 siblings, 1 reply; 3+ messages in thread
From: Damien Le Moal @ 2022-04-18 22:24 UTC (permalink / raw)
  To: Sam Li, qemu-devel; +Cc: Stefan Hajnoczi, Dmitry Fomichev, Hannes Reinecke

On 2022/04/18 18:05, Sam Li wrote:
> fix code style issue.

This patch must be squashed into the previous one.

> 
> Signed-off-by: Sam Li <faithilikerun@gmail.com>
> ---
>  block/io_uring.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/block/io_uring.c b/block/io_uring.c
> index 2942967126..57745ecfa1 100644
> --- a/block/io_uring.c
> +++ b/block/io_uring.c
> @@ -436,10 +436,15 @@ LuringState *luring_init(Error **errp)
>  
>      ioq_init(&s->io_q);
>      if (io_uring_register_ring_fd(&s->ring) < 0) {
> -        error_setg_errno(errp, errno, "failed to register linux io_uring ring file descriptor");
> +        /*
> +         * If the function fails, it will fallback to the non-optimized io_uring
> +         * operations.
> +         */

The comment wording is a little odd: given that the comment is inside the "if",
meaning that we are in the case "the function failed", saying "if the function
fails..." is strange. You could simply state something like:

	/*
	 * Only warn about this error: we will fall back to the non-optimized
	 * io_uring operations.
	 */

> +        error_setg_errno(errp, errno,
> +                         "failed to register linux io_uring ring file descriptor");
>      }
> -    return s;
>  
> +    return s;
>  }
>  
>  void luring_cleanup(LuringState *s)


-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH 2/2] Use io_ring_register_ring_fd() to skip fd operations
  2022-04-18 22:24 ` Damien Le Moal
@ 2022-04-18 23:36   ` olc
  0 siblings, 0 replies; 3+ messages in thread
From: olc @ 2022-04-18 23:36 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Dmitry Fomichev, Stefan Hajnoczi, qemu-devel, Hannes Reinecke

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

Thanks for noticing the problem. I've done that.

Sam

Damien Le Moal <Damien.LeMoal@wdc.com> 于2022年4月19日周二 06:24写道:

> On 2022/04/18 18:05, Sam Li wrote:
> > fix code style issue.
>
> This patch must be squashed into the previous one.
>
> >
> > Signed-off-by: Sam Li <faithilikerun@gmail.com>
> > ---
> >  block/io_uring.c | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/block/io_uring.c b/block/io_uring.c
> > index 2942967126..57745ecfa1 100644
> > --- a/block/io_uring.c
> > +++ b/block/io_uring.c
> > @@ -436,10 +436,15 @@ LuringState *luring_init(Error **errp)
> >
> >      ioq_init(&s->io_q);
> >      if (io_uring_register_ring_fd(&s->ring) < 0) {
> > -        error_setg_errno(errp, errno, "failed to register linux
> io_uring ring file descriptor");
> > +        /*
> > +         * If the function fails, it will fallback to the non-optimized
> io_uring
> > +         * operations.
> > +         */
>
> The comment wording is a little odd: given that the comment is inside the
> "if",
> meaning that we are in the case "the function failed", saying "if the
> function
> fails..." is strange. You could simply state something like:
>
>         /*
>          * Only warn about this error: we will fall back to the
> non-optimized
>          * io_uring operations.
>          */
>
> > +        error_setg_errno(errp, errno,
> > +                         "failed to register linux io_uring ring file
> descriptor");
> >      }
> > -    return s;
> >
> > +    return s;
> >  }
> >
> >  void luring_cleanup(LuringState *s)
>
>
> --
> Damien Le Moal
> Western Digital Research

[-- Attachment #2: Type: text/html, Size: 2389 bytes --]

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

end of thread, other threads:[~2022-04-18 23:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18  9:05 [PATCH 2/2] Use io_ring_register_ring_fd() to skip fd operations Sam Li
2022-04-18 22:24 ` Damien Le Moal
2022-04-18 23:36   ` olc

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.