* [PATCH liburing v1 0/2] Fixes for io_uring_for_each_cqe
@ 2023-06-09 1:54 Ammar Faizi
2023-06-09 1:54 ` [PATCH liburing v1 1/2] man/io_uring_for_each_cqe: Fix return value, title, and typo Ammar Faizi
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Ammar Faizi @ 2023-06-09 1:54 UTC (permalink / raw)
To: Jens Axboe
Cc: Ammar Faizi, Alviro Iskandar Setiawan, GNU/Weeb Mailing List,
Pavel Begunkov, io-uring Mailing List, Linux Kernel Mailing List
Hi Jens,
Please consider taking these last-minute fixes for liburing-2.4
release. There are two patches in this series:
## 1. man/io_uring_for_each_cqe: Fix return value, title, and typo
- Fix the return value. io_uring_for_each_cqe() doesn't return an int.
- Fix the title, it was io_uring_wait_cqes(), it should be
io_uring_for_each_cqe().
- Fix typo: s/io_uring_for_each_cqes/io_uring_for_each_cqe/.
## 2. Explicitly tell it's a macro and add an example
Let the reader directly know that it's not a function, but a macro.
Also, give a simple example of its usage.
Signed-off-by: Alviro Iskandar Setiawan <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---
Ammar Faizi (2):
man/io_uring_for_each_cqe: Fix return value, title, and typo
man/io_uring_for_each_cqe: Explicitly tell it's a macro and add an example
man/io_uring_for_each_cqe.3 | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
base-commit: b4ee3108b93f7e4602430246236d14978abad085
--
Ammar Faizi
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH liburing v1 1/2] man/io_uring_for_each_cqe: Fix return value, title, and typo
2023-06-09 1:54 [PATCH liburing v1 0/2] Fixes for io_uring_for_each_cqe Ammar Faizi
@ 2023-06-09 1:54 ` Ammar Faizi
2023-06-09 1:54 ` [PATCH liburing v1 2/2] man/io_uring_for_each_cqe: Explicitly tell it's a macro and add an example Ammar Faizi
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Ammar Faizi @ 2023-06-09 1:54 UTC (permalink / raw)
To: Jens Axboe
Cc: Ammar Faizi, Alviro Iskandar Setiawan, GNU/Weeb Mailing List,
Pavel Begunkov, io-uring Mailing List, Linux Kernel Mailing List
1) Fix the return value. io_uring_for_each_cqe() doesn't return an int.
2) Fix the title, it was io_uring_wait_cqes(), it should be
io_uring_for_each_cqe().
3) Fix typo: s/io_uring_for_each_cqes/io_uring_for_each_cqe/
Fixes: 16d74b1c76043e6 ("man: add man page for io_uring_for_each_cqe()")
Reported-by: Alviro Iskandar Setiawan <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---
man/io_uring_for_each_cqe.3 | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/man/io_uring_for_each_cqe.3 b/man/io_uring_for_each_cqe.3
index 9230d147515c78fb..8445fd605d0b02a6 100644
--- a/man/io_uring_for_each_cqe.3
+++ b/man/io_uring_for_each_cqe.3
@@ -2,16 +2,16 @@
.\"
.\" SPDX-License-Identifier: LGPL-2.0-or-later
.\"
-.TH io_uring_wait_cqes 3 "June 04, 2023" "liburing-2.4" "liburing Manual"
+.TH io_uring_for_each_cqe 3 "June 04, 2023" "liburing-2.4" "liburing Manual"
.SH NAME
io_uring_for_each_cqe \- iterate pending completion events
.SH SYNOPSIS
.nf
.B #include <liburing.h>
.PP
-.BI "int io_uring_for_each_cqes(struct io_uring *" ring ","
-.BI " unsigned " head ","
-.BI " struct io_uring_cqe *" cqe ");
+.BI "io_uring_for_each_cqe(struct io_uring *" ring ","
+.BI " unsigned " head ","
+.BI " struct io_uring_cqe *" cqe ") { }
.fi
.SH DESCRIPTION
.PP
--
Ammar Faizi
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH liburing v1 2/2] man/io_uring_for_each_cqe: Explicitly tell it's a macro and add an example
2023-06-09 1:54 [PATCH liburing v1 0/2] Fixes for io_uring_for_each_cqe Ammar Faizi
2023-06-09 1:54 ` [PATCH liburing v1 1/2] man/io_uring_for_each_cqe: Fix return value, title, and typo Ammar Faizi
@ 2023-06-09 1:54 ` Ammar Faizi
2023-06-09 3:02 ` [PATCH liburing v1 0/2] Fixes for io_uring_for_each_cqe Jens Axboe
2023-06-09 3:02 ` Jens Axboe
3 siblings, 0 replies; 5+ messages in thread
From: Ammar Faizi @ 2023-06-09 1:54 UTC (permalink / raw)
To: Jens Axboe
Cc: Ammar Faizi, Alviro Iskandar Setiawan, GNU/Weeb Mailing List,
Pavel Begunkov, io-uring Mailing List, Linux Kernel Mailing List
Let the reader directly know that it's not a function, but a macro.
Also, give a simple example of its usage.
Co-authored-by: Alviro Iskandar Setiawan <[email protected]>
Signed-off-by: Alviro Iskandar Setiawan <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---
man/io_uring_for_each_cqe.3 | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/man/io_uring_for_each_cqe.3 b/man/io_uring_for_each_cqe.3
index 8445fd605d0b02a6..78d8f6fc168d12e3 100644
--- a/man/io_uring_for_each_cqe.3
+++ b/man/io_uring_for_each_cqe.3
@@ -17,7 +17,7 @@ io_uring_for_each_cqe \- iterate pending completion events
.PP
The
.BR io_uring_for_each_cqe (3)
-helper iterates completion events belonging to the
+is a macro helper that iterates completion events belonging to the
.I ring
using
.I head
@@ -35,6 +35,24 @@ calling
.BR io_uring_cqe_seen (3)
for each of them.
+.SH EXAMPLE
+.EX
+void handle_cqes(struct io_uring *ring)
+{
+ struct io_uring_cqe *cqe;
+ unsigned head;
+ unsigned i = 0;
+
+ io_uring_for_each_cqe(ring, head, cqe) {
+ /* handle completion */
+ printf("cqe: %d\\n", cqe->res);
+ i++;
+ }
+
+ io_uring_cq_advance(ring, i);
+}
+.EE
+
.SH RETURN VALUE
None
.SH SEE ALSO
--
Ammar Faizi
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH liburing v1 0/2] Fixes for io_uring_for_each_cqe
2023-06-09 1:54 [PATCH liburing v1 0/2] Fixes for io_uring_for_each_cqe Ammar Faizi
2023-06-09 1:54 ` [PATCH liburing v1 1/2] man/io_uring_for_each_cqe: Fix return value, title, and typo Ammar Faizi
2023-06-09 1:54 ` [PATCH liburing v1 2/2] man/io_uring_for_each_cqe: Explicitly tell it's a macro and add an example Ammar Faizi
@ 2023-06-09 3:02 ` Jens Axboe
2023-06-09 3:02 ` Jens Axboe
3 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2023-06-09 3:02 UTC (permalink / raw)
To: Ammar Faizi
Cc: Alviro Iskandar Setiawan, GNU/Weeb Mailing List, Pavel Begunkov,
io-uring Mailing List, Linux Kernel Mailing List
On 6/8/23 7:54 PM, Ammar Faizi wrote:
> Hi Jens,
>
> Please consider taking these last-minute fixes for liburing-2.4
> release. There are two patches in this series:
>
> ## 1. man/io_uring_for_each_cqe: Fix return value, title, and typo
>
> - Fix the return value. io_uring_for_each_cqe() doesn't return an int.
>
> - Fix the title, it was io_uring_wait_cqes(), it should be
> io_uring_for_each_cqe().
>
> - Fix typo: s/io_uring_for_each_cqes/io_uring_for_each_cqe/.
>
> ## 2. Explicitly tell it's a macro and add an example
>
> Let the reader directly know that it's not a function, but a macro.
> Also, give a simple example of its usage.
Applied, even though not super critical for release. But this should
be it, I'll announce 2.4 tomorrow.
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH liburing v1 0/2] Fixes for io_uring_for_each_cqe
2023-06-09 1:54 [PATCH liburing v1 0/2] Fixes for io_uring_for_each_cqe Ammar Faizi
` (2 preceding siblings ...)
2023-06-09 3:02 ` [PATCH liburing v1 0/2] Fixes for io_uring_for_each_cqe Jens Axboe
@ 2023-06-09 3:02 ` Jens Axboe
3 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2023-06-09 3:02 UTC (permalink / raw)
To: Ammar Faizi
Cc: Alviro Iskandar Setiawan, GNU/Weeb Mailing List, Pavel Begunkov,
io-uring Mailing List, Linux Kernel Mailing List
On Fri, 09 Jun 2023 08:54:01 +0700, Ammar Faizi wrote:
> Please consider taking these last-minute fixes for liburing-2.4
> release. There are two patches in this series:
>
> ## 1. man/io_uring_for_each_cqe: Fix return value, title, and typo
>
> - Fix the return value. io_uring_for_each_cqe() doesn't return an int.
>
> [...]
Applied, thanks!
[1/2] man/io_uring_for_each_cqe: Fix return value, title, and typo
commit: c8d06ed9bcbf2ae294242f9caacecfa01bf138b2
[2/2] man/io_uring_for_each_cqe: Explicitly tell it's a macro and add an example
commit: 298c083d75ecde5a8833366167b3b6abff0c8d39
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-06-09 3:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-09 1:54 [PATCH liburing v1 0/2] Fixes for io_uring_for_each_cqe Ammar Faizi
2023-06-09 1:54 ` [PATCH liburing v1 1/2] man/io_uring_for_each_cqe: Fix return value, title, and typo Ammar Faizi
2023-06-09 1:54 ` [PATCH liburing v1 2/2] man/io_uring_for_each_cqe: Explicitly tell it's a macro and add an example Ammar Faizi
2023-06-09 3:02 ` [PATCH liburing v1 0/2] Fixes for io_uring_for_each_cqe Jens Axboe
2023-06-09 3:02 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox