Skip to content

Commit d5e9053

Browse files
authored
chore: upgrade io-uring to 0.6.0 (tokio-rs#277)
Signed-off-by: Li Zhanhui <[email protected]>
1 parent 34b27ab commit d5e9053

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ keywords = ["async", "fs", "io-uring"]
2020
tokio = { version = "1.2", features = ["net", "rt", "sync"] }
2121
slab = "0.4.2"
2222
libc = "0.2.80"
23-
io-uring = "0.5.13"
23+
io-uring = "0.6.0"
2424
socket2 = { version = "0.4.4", features = ["all"] }
2525
bytes = { version = "1.0", optional = true }
2626
futures-util = { version = "0.3.26", default-features = false, features = ["std"] }

src/io/fallocate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ impl Op<Fallocate> {
2525
x.handle().expect("not in a runtime context").submit_op(
2626
Fallocate { fd: fd.clone() },
2727
|fallocate| {
28-
opcode::Fallocate64::new(types::Fd(fallocate.fd.raw_fd()), len as _)
29-
.offset64(offset as _)
28+
opcode::Fallocate::new(types::Fd(fallocate.fd.raw_fd()), len as _)
29+
.offset(offset as _)
3030
.mode(flags)
3131
.build()
3232
},

src/io/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<T: BoundedBuf> UnsubmittedWrite<T> {
4949
buf,
5050
},
5151
WriteTransform {
52-
_phantom: PhantomData::default(),
52+
_phantom: PhantomData,
5353
},
5454
opcode::Write::new(types::Fd(fd.raw_fd()), ptr, len as _)
5555
.offset(offset as _)

src/io/writev_all.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl<T: BoundedBuf> Op<WritevAll<T>> {
134134
// So this wouldn't need to be a function. Just pass in the entry.
135135
|write| {
136136
opcode::Writev::new(types::Fd(write.fd.raw_fd()), iovs_ptr, iovs_len)
137-
.offset64(offset as _)
137+
.offset(offset as _)
138138
.build()
139139
},
140140
)

src/runtime/driver/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ impl Driver {
9797
&mut self,
9898
buffers: Rc<RefCell<dyn FixedBuffers>>,
9999
) -> io::Result<()> {
100-
self.uring
101-
.submitter()
102-
.register_buffers(buffers.borrow().iovecs())?;
100+
unsafe {
101+
self.uring
102+
.submitter()
103+
.register_buffers(buffers.borrow().iovecs())
104+
}?;
103105

104106
self.fixed_buffers = Some(buffers);
105107
Ok(())

0 commit comments

Comments
 (0)