From: Ammar Faizi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Ammar Faizi <[email protected]>,
Caleb Sander <[email protected]>,
Muhammad Rizki <[email protected]>,
Kanna Scarlet <[email protected]>,
io-uring Mailing List <[email protected]>,
Linux Kernel Mailing List <[email protected]>,
GNU/Weeb Mailing List <[email protected]>
Subject: [PATCH liburing v2 1/7] syscall: Make io_uring syscall arguments consistent
Date: Tue, 30 Aug 2022 07:56:37 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
From: Ammar Faizi <[email protected]>
Make the arguments of io_uring syscalls consistent with what is said in
the manpage. No functional change is intended.
Link: https://lore.kernel.org/io-uring/CADUfDZpE_gPyfN=dLKB6nu-++ZKyebpWTvYGNOmdP1-c_BLZZA@mail.gmail.com
Link: https://lore.kernel.org/io-uring/CADUfDZr0mPn_REb24aEPa477T+CYeoV5hcbURqX9kazCUqRp4A@mail.gmail.com
Suggested-by: Caleb Sander <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---
src/arch/generic/syscall.h | 19 ++++++++++---------
src/arch/syscall-defs.h | 19 ++++++++++---------
2 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/src/arch/generic/syscall.h b/src/arch/generic/syscall.h
index 5a172e1..00730e0 100644
--- a/src/arch/generic/syscall.h
+++ b/src/arch/generic/syscall.h
@@ -5,15 +5,15 @@
#include <fcntl.h>
-static inline int __sys_io_uring_register(int fd, unsigned opcode,
- const void *arg, unsigned nr_args)
+static inline int __sys_io_uring_register(unsigned int fd, unsigned int opcode,
+ const void *arg, unsigned int nr_args)
{
int ret;
ret = syscall(__NR_io_uring_register, fd, opcode, arg, nr_args);
return (ret < 0) ? -errno : ret;
}
-static inline int __sys_io_uring_setup(unsigned entries,
+static inline int __sys_io_uring_setup(unsigned int entries,
struct io_uring_params *p)
{
int ret;
@@ -21,9 +21,10 @@ static inline int __sys_io_uring_setup(unsigned entries,
return (ret < 0) ? -errno : ret;
}
-static inline int __sys_io_uring_enter2(int fd, unsigned to_submit,
- unsigned min_complete, unsigned flags,
- sigset_t *sig, int sz)
+static inline int __sys_io_uring_enter2(unsigned int fd, unsigned int to_submit,
+ unsigned int min_complete,
+ unsigned int flags, sigset_t *sig,
+ size_t sz)
{
int ret;
ret = syscall(__NR_io_uring_enter, fd, to_submit, min_complete, flags,
@@ -31,9 +32,9 @@ static inline int __sys_io_uring_enter2(int fd, unsigned to_submit,
return (ret < 0) ? -errno : ret;
}
-static inline int __sys_io_uring_enter(int fd, unsigned to_submit,
- unsigned min_complete, unsigned flags,
- sigset_t *sig)
+static inline int __sys_io_uring_enter(unsigned int fd, unsigned int to_submit,
+ unsigned int min_complete,
+ unsigned int flags, sigset_t *sig)
{
return __sys_io_uring_enter2(fd, to_submit, min_complete, flags, sig,
_NSIG / 8);
diff --git a/src/arch/syscall-defs.h b/src/arch/syscall-defs.h
index 374aa0d..4afb2af 100644
--- a/src/arch/syscall-defs.h
+++ b/src/arch/syscall-defs.h
@@ -61,30 +61,31 @@ static inline int __sys_close(int fd)
return (int) __do_syscall1(__NR_close, fd);
}
-static inline int __sys_io_uring_register(int fd, unsigned opcode,
- const void *arg, unsigned nr_args)
+static inline int __sys_io_uring_register(unsigned int fd, unsigned int opcode,
+ const void *arg, unsigned int nr_args)
{
return (int) __do_syscall4(__NR_io_uring_register, fd, opcode, arg,
nr_args);
}
-static inline int __sys_io_uring_setup(unsigned entries,
+static inline int __sys_io_uring_setup(unsigned int entries,
struct io_uring_params *p)
{
return (int) __do_syscall2(__NR_io_uring_setup, entries, p);
}
-static inline int __sys_io_uring_enter2(int fd, unsigned to_submit,
- unsigned min_complete, unsigned flags,
- sigset_t *sig, int sz)
+static inline int __sys_io_uring_enter2(unsigned int fd, unsigned int to_submit,
+ unsigned int min_complete,
+ unsigned int flags, sigset_t *sig,
+ size_t sz)
{
return (int) __do_syscall6(__NR_io_uring_enter, fd, to_submit,
min_complete, flags, sig, sz);
}
-static inline int __sys_io_uring_enter(int fd, unsigned to_submit,
- unsigned min_complete, unsigned flags,
- sigset_t *sig)
+static inline int __sys_io_uring_enter(unsigned int fd, unsigned int to_submit,
+ unsigned int min_complete,
+ unsigned int flags, sigset_t *sig)
{
return __sys_io_uring_enter2(fd, to_submit, min_complete, flags, sig,
_NSIG / 8);
--
Ammar Faizi
next prev parent reply other threads:[~2022-08-30 0:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 0:56 [PATCH liburing v2 0/7] Export io_uring syscall functions Ammar Faizi
2022-08-30 0:56 ` Ammar Faizi [this message]
2022-08-30 0:56 ` [PATCH liburing v2 2/7] syscall: Add " Ammar Faizi
2022-08-30 0:56 ` [PATCH liburing v2 3/7] man: Clarify "man 2" entry for io_uring syscalls Ammar Faizi
2022-08-30 0:56 ` [PATCH liburing v2 4/7] man: Add `io_uring_enter2()` function signature Ammar Faizi
2022-08-30 0:56 ` [PATCH liburing v2 5/7] man: Alias `io_uring_enter2()` to `io_uring_enter()` Ammar Faizi
2022-08-30 0:56 ` [PATCH liburing v2 6/7] test/io_uring_{enter,setup,register}: Use the exported syscall functions Ammar Faizi
2022-08-30 0:56 ` [PATCH liburing v2 7/7] man/io_uring_enter.2: Fix typo "which is behaves" -> "which behaves" Ammar Faizi
2022-08-30 14:14 ` [PATCH liburing v2 0/7] Export io_uring syscall functions Jens Axboe
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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