From d9bc89dd9a5c5245b9d9486cfe4313be9227b7c4 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 11 Feb 2021 21:15:27 -0500 Subject: [PATCH 1/4] use int64_t types instead of loff_t See liburing's aeee6681b14fb6fbd087edd58fcf811077651c16 for details. They moved away from loff_t, and the code as is doesn't compile with liburing's master branch. --- rusturing.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rusturing.c b/rusturing.c index 0b5e98d..541d031 100644 --- a/rusturing.c +++ b/rusturing.c @@ -41,8 +41,8 @@ extern inline void rust_io_uring_prep_rw(int op, } extern inline void rust_io_uring_prep_splice(struct io_uring_sqe *sqe, - int fd_in, loff_t off_in, - int fd_out, loff_t off_out, + int fd_in, int64_t off_in, + int fd_out, int64_t off_out, unsigned int nbytes, unsigned int splice_flags) { From b61f3c96656a4764ff66bca4ee783fd4fcef91ea Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 11 Feb 2021 21:53:47 -0500 Subject: [PATCH 2/4] pad structures to match liburing 25bbcbef3e0a8bfba8044be55d08d5116c51dccd added padding to the sq and cq structures. The iou unit tests all fail once liburing is updated to their main branch, which I tracked down to the commit above. This patch also bumps the liburing submodule, to keep things in sync. Although you have in the past expressed a justified preference to use official releases, a release of liburing is really close and I don't see another way to contribute the patch to add the padding without breaking anything if the submodule doesn't move. --- liburing | 2 +- src/lib.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/liburing b/liburing index 45f0735..10a9ff8 160000 --- a/liburing +++ b/liburing @@ -1 +1 @@ -Subproject commit 45f0735219a615ae848033c47c7e2d85d101d43e +Subproject commit 10a9ff846dd62d2975f791c21731aafe1f8562bb diff --git a/src/lib.rs b/src/lib.rs index a9bb200..c4270b9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -136,6 +136,8 @@ pub struct io_uring_sq { pub ring_sz: libc::size_t, pub ring_ptr: *mut libc::c_void, + + pub pad: [libc::c_uint; 4], } #[derive(Debug)] @@ -151,6 +153,8 @@ pub struct io_uring_cq { pub ring_sz: libc::size_t, pub ring_ptr: *mut libc::c_void, + + pub pad: [libc::c_uint; 4], } #[repr(C)] From 5994eb1747dd3f1de6ef76d0789b7d3a828ab2d1 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Wed, 9 Sep 2020 09:27:04 -0400 Subject: [PATCH 3/4] implement the free_probe function, newly added to liburing --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index c4270b9..100a6e7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -302,6 +302,8 @@ extern { pub fn io_uring_get_probe() -> *mut io_uring_probe; + pub fn io_uring_free_probe(probe: *mut io_uring_probe); + pub fn io_uring_dontfork(ring: *mut io_uring) -> libc::c_int; pub fn io_uring_queue_exit(ring: *mut io_uring); From acc34547563fa19cca64b7e3073bda0f5953079e Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Fri, 12 Feb 2021 06:27:38 -0500 Subject: [PATCH 4/4] pad the io_uring structure to match liburing's padding is also needed in the io_uring struct. I didn't notice it before because all tests for iou (and glommio) pass just fine without it in debug mode, but it turns out they fail in release mode. --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 100a6e7..5ad5070 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -117,6 +117,9 @@ pub struct io_uring { pub cq: io_uring_cq, pub flags: libc::c_uint, pub ring_fd: libc::c_int, + + pub features: libc::c_uint, + pub pad: [libc::c_uint; 3], } #[derive(Debug)]