From d5e90539bd6d1c518e848298564a098c300866bc Mon Sep 17 00:00:00 2001 From: Zhanhui Li Date: Sun, 13 Aug 2023 02:51:24 +0800 Subject: [PATCH 1/3] 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(()) From 926ff9de010f517cad9d3effe83e6e38f02dfc7f Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Mon, 8 Jan 2024 19:17:18 +0900 Subject: [PATCH 2/3] chore: format let-else (#291) This fixes CI failure https://github.com/tokio-rs/tokio-uring/actions/runs/7437161507/job/20234483955?pr=290. rustfmt recently supported the formatting of let-else syntax, so CI did not fail before. --- src/buf/fixed/plumbing/registry.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buf/fixed/plumbing/registry.rs b/src/buf/fixed/plumbing/registry.rs index ff8ffe30..4f88746e 100644 --- a/src/buf/fixed/plumbing/registry.rs +++ b/src/buf/fixed/plumbing/registry.rs @@ -74,7 +74,7 @@ impl Registry { pub(crate) fn check_out(&mut self, index: usize) -> Option { let state = self.states.get_mut(index)?; let BufState::Free { init_len } = *state else { - return None + return None; }; *state = BufState::CheckedOut; From a69d4bf57776a085a6516f4c022e2bf5d1814762 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Mon, 8 Jan 2024 19:18:39 +0900 Subject: [PATCH 3/3] chore: update actions/checkout action to v4 (#290) Co-authored-by: ollie <72926894+ollie-etl@users.noreply.github.com> --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1225f7c..1f024c08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: bench: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update stable - run: cargo bench --no-run @@ -38,7 +38,7 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update stable - run: cargo check @@ -46,7 +46,7 @@ jobs: clippy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update stable - run: cargo clippy @@ -54,7 +54,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update stable - run: cargo test @@ -62,7 +62,7 @@ jobs: test-docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update stable - run: cargo test --doc @@ -70,7 +70,7 @@ jobs: fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update stable - run: cargo fmt -- --check @@ -78,7 +78,7 @@ jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update nightly && rustup default nightly - run: cargo doc --no-deps --all-features