From d5e90539bd6d1c518e848298564a098c300866bc Mon Sep 17 00:00:00 2001 From: Zhanhui Li Date: Sun, 13 Aug 2023 02:51:24 +0800 Subject: [PATCH] chore: upgrade io-uring to 0.6.0 (#277) Signed-off-by: Li Zhanhui --- Cargo.toml | 2 +- src/io/fallocate.rs | 4 ++-- src/io/write.rs | 2 +- src/io/writev_all.rs | 2 +- src/runtime/driver/mod.rs | 8 +++++--- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9b707e80..8bdec82e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ keywords = ["async", "fs", "io-uring"] tokio = { version = "1.2", features = ["net", "rt", "sync"] } slab = "0.4.2" libc = "0.2.80" -io-uring = "0.5.13" +io-uring = "0.6.0" socket2 = { version = "0.4.4", features = ["all"] } bytes = { version = "1.0", optional = true } futures-util = { version = "0.3.26", default-features = false, features = ["std"] } diff --git a/src/io/fallocate.rs b/src/io/fallocate.rs index fa932124..382710d0 100644 --- a/src/io/fallocate.rs +++ b/src/io/fallocate.rs @@ -25,8 +25,8 @@ impl Op { x.handle().expect("not in a runtime context").submit_op( Fallocate { fd: fd.clone() }, |fallocate| { - opcode::Fallocate64::new(types::Fd(fallocate.fd.raw_fd()), len as _) - .offset64(offset as _) + opcode::Fallocate::new(types::Fd(fallocate.fd.raw_fd()), len as _) + .offset(offset as _) .mode(flags) .build() }, diff --git a/src/io/write.rs b/src/io/write.rs index 9063282b..6c607f75 100644 --- a/src/io/write.rs +++ b/src/io/write.rs @@ -49,7 +49,7 @@ impl UnsubmittedWrite { buf, }, WriteTransform { - _phantom: PhantomData::default(), + _phantom: PhantomData, }, opcode::Write::new(types::Fd(fd.raw_fd()), ptr, len as _) .offset(offset as _) diff --git a/src/io/writev_all.rs b/src/io/writev_all.rs index 38ee8a63..ef5b9d40 100644 --- a/src/io/writev_all.rs +++ b/src/io/writev_all.rs @@ -134,7 +134,7 @@ impl Op> { // So this wouldn't need to be a function. Just pass in the entry. |write| { opcode::Writev::new(types::Fd(write.fd.raw_fd()), iovs_ptr, iovs_len) - .offset64(offset as _) + .offset(offset as _) .build() }, ) diff --git a/src/runtime/driver/mod.rs b/src/runtime/driver/mod.rs index 21d7de0b..f57605d6 100644 --- a/src/runtime/driver/mod.rs +++ b/src/runtime/driver/mod.rs @@ -97,9 +97,11 @@ impl Driver { &mut self, buffers: Rc>, ) -> io::Result<()> { - self.uring - .submitter() - .register_buffers(buffers.borrow().iovecs())?; + unsafe { + self.uring + .submitter() + .register_buffers(buffers.borrow().iovecs()) + }?; self.fixed_buffers = Some(buffers); Ok(())