85 lines
2.9 KiB
Diff
85 lines
2.9 KiB
Diff
From c915bf597b6a22e8c5ca25839b04130ed941f69a Mon Sep 17 00:00:00 2001
|
|
From: "Dmitry V. Levin" <ldv@strace.io>
|
|
Date: Fri, 28 Apr 2023 08:00:00 +0000
|
|
Subject: [PATCH] io_uring: rename pad field of io_uring_buf_reg to flags
|
|
|
|
* bundled/linux/include/uapi/linux/io_uring.h (struct io_uring_buf_reg):
|
|
Rename pad to flags following the change introduced by Linux kernel
|
|
commit v6.3-rc5-6-g81cf17cd3ab3.
|
|
* src/io_uring.c (print_io_uring_buf_reg): Likewise.
|
|
* tests/io_uring_register.c (main): Likewise.
|
|
---
|
|
bundled/linux/include/uapi/linux/io_uring.h | 2 +-
|
|
src/io_uring.c | 8 +++-----
|
|
tests/io_uring_register.c | 6 +++---
|
|
3 files changed, 7 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/bundled/linux/include/uapi/linux/io_uring.h b/bundled/linux/include/uapi/linux/io_uring.h
|
|
index 0ad3da2..60338e8 100644
|
|
--- a/bundled/linux/include/uapi/linux/io_uring.h
|
|
+++ b/bundled/linux/include/uapi/linux/io_uring.h
|
|
@@ -525,7 +525,7 @@ struct io_uring_buf_reg {
|
|
__u64 ring_addr;
|
|
__u32 ring_entries;
|
|
__u16 bgid;
|
|
- __u16 pad;
|
|
+ __u16 flags;
|
|
__u64 resv[3];
|
|
};
|
|
|
|
diff --git a/src/io_uring.c b/src/io_uring.c
|
|
index 1f3c6bb..0882ee7 100644
|
|
--- a/src/io_uring.c
|
|
+++ b/src/io_uring.c
|
|
@@ -565,7 +565,7 @@ print_io_uring_buf_reg(struct tcb *tcp, const kernel_ulong_t addr)
|
|
{
|
|
struct io_uring_buf_reg arg;
|
|
CHECK_TYPE_SIZE(arg, 40);
|
|
- CHECK_TYPE_SIZE(arg.pad, sizeof(uint16_t));
|
|
+ CHECK_TYPE_SIZE(arg.flags, sizeof(uint16_t));
|
|
CHECK_TYPE_SIZE(arg.resv, sizeof(uint64_t) * 3);
|
|
|
|
if (umove_or_printaddr(tcp, addr, &arg))
|
|
@@ -580,10 +580,8 @@ print_io_uring_buf_reg(struct tcb *tcp, const kernel_ulong_t addr)
|
|
tprint_struct_next();
|
|
PRINT_FIELD_U(arg, bgid);
|
|
|
|
- if (arg.pad) {
|
|
- tprint_struct_next();
|
|
- PRINT_FIELD_X(arg, pad);
|
|
- }
|
|
+ tprint_struct_next();
|
|
+ PRINT_FIELD_X(arg, flags);
|
|
|
|
if (!IS_ARRAY_ZERO(arg.resv)) {
|
|
tprint_struct_next();
|
|
diff --git a/tests/io_uring_register.c b/tests/io_uring_register.c
|
|
index 3b7879a..8f49eae 100644
|
|
--- a/tests/io_uring_register.c
|
|
+++ b/tests/io_uring_register.c
|
|
@@ -1102,7 +1102,7 @@ main(void)
|
|
buf_reg->ring_addr = j & 2 ? (uintptr_t) buf_reg : 0;
|
|
buf_reg->ring_entries = j & 4 ? 3141592653 : 0;
|
|
buf_reg->bgid = j & 8 ? 42069 : 0;
|
|
- buf_reg->pad = j & 16 ? 31337 : 0;
|
|
+ buf_reg->flags = j & 16 ? 31337 : 0;
|
|
buf_reg->resv[0] = j & 32 ? 0xbadc0deddeadfaceULL : 0;
|
|
buf_reg->resv[1] = j & 64 ? 0xdecaffedbeefdeadULL : 0;
|
|
buf_reg->resv[2] = j & 128 ? 0xbadc0dedfacefeedULL : 0;
|
|
@@ -1117,10 +1117,10 @@ main(void)
|
|
printf("%p", buf_reg);
|
|
else
|
|
printf("NULL");
|
|
- printf(", ring_entries=%s, bgid=%s%s",
|
|
+ printf(", ring_entries=%s, bgid=%s, flags=%s",
|
|
j & 4 ? "3141592653" : "0",
|
|
j & 8 ? "42069" : "0",
|
|
- j & 16 ? ", pad=0x7a69" : "");
|
|
+ j & 16 ? "0x7a69" : "0");
|
|
if (j & 0xe0) {
|
|
printf(", resv=[%s, %s, %s]",
|
|
j & 32 ? "0xbadc0deddeadface" : "0",
|
|
--
|
|
2.33.0
|
|
|