diff mbox series

[liburing,v2,1/7] syscall: Make io_uring syscall arguments consistent

Message ID 20220830005122.885209-2-ammar.faizi@intel.com (mailing list archive)
State New
Headers show
Series Export io_uring syscall functions | expand

Commit Message

Ammar Faizi Aug. 30, 2022, 12:56 a.m. UTC
From: Ammar Faizi <ammarfaizi2@gnuweeb.org>

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 <csander@purestorage.com>
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
---
 src/arch/generic/syscall.h | 19 ++++++++++---------
 src/arch/syscall-defs.h    | 19 ++++++++++---------
 2 files changed, 20 insertions(+), 18 deletions(-)
diff mbox series

Patch

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);