Skip to content

Commit fcba072

Browse files
author
Lucas Paixão
committed
Remove Pin<Box<Op<T>>> due to Lifecycle migration to ArcMonitor on Op<T>
1 parent b92851b commit fcba072

27 files changed

+36
-84
lines changed

src/io/accept.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use crate::runtime::driver::op;
33
use crate::runtime::driver::op::{Completable, Op};
44
use crate::runtime::CONTEXT;
55
use std::net::SocketAddr;
6-
use std::pin::Pin;
76
use std::{boxed::Box, io};
87

98
pub(crate) struct Accept {
@@ -12,7 +11,7 @@ pub(crate) struct Accept {
1211
}
1312

1413
impl Op<Accept> {
15-
pub(crate) fn accept(fd: &SharedFd) -> io::Result<Pin<Box<Op<Accept>>>> {
14+
pub(crate) fn accept(fd: &SharedFd) -> io::Result<Op<Accept>> {
1615
use io_uring::{opcode, types};
1716

1817
let socketaddr = Box::new((

src/io/close.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ use crate::runtime::driver::op::{Completable, Op};
33
use crate::runtime::CONTEXT;
44
use std::io;
55
use std::os::unix::io::RawFd;
6-
use std::pin::Pin;
76

87
pub(crate) struct Close {
98
fd: RawFd,
109
}
1110

1211
impl Op<Close> {
13-
pub(crate) fn close(fd: RawFd) -> io::Result<Pin<Box<Op<Close>>>> {
12+
pub(crate) fn close(fd: RawFd) -> io::Result<Op<Close>> {
1413
use io_uring::{opcode, types};
1514

1615
CONTEXT.with(|x| {

src/io/connect.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use crate::runtime::driver::op::{Completable, CqeResult, Op};
33
use crate::runtime::CONTEXT;
44
use socket2::SockAddr;
55
use std::io;
6-
use std::pin::Pin;
76

87
/// Open a file
98
pub(crate) struct Connect {
@@ -15,7 +14,7 @@ pub(crate) struct Connect {
1514

1615
impl Op<Connect> {
1716
/// Submit a request to connect.
18-
pub(crate) fn connect(fd: &SharedFd, socket_addr: SockAddr) -> io::Result<Pin<Box<Op<Connect>>>> {
17+
pub(crate) fn connect(fd: &SharedFd, socket_addr: SockAddr) -> io::Result<Op<Connect>> {
1918
use io_uring::{opcode, types};
2019

2120
CONTEXT.with(|x| {

src/io/fallocate.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use io_uring::{opcode, types};
22
use std::io;
3-
use std::pin::Pin;
43

54
use crate::{
65
io::SharedFd,
@@ -20,7 +19,7 @@ impl Op<Fallocate> {
2019
offset: u64,
2120
len: u64,
2221
flags: i32,
23-
) -> io::Result<Pin<Box<Op<Fallocate>>>> {
22+
) -> io::Result<Op<Fallocate>> {
2423
CONTEXT.with(|x| {
2524
x.handle()
2625
.submit_op(Fallocate { fd: fd.clone() }, |fallocate| {

src/io/fsync.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@ use crate::runtime::driver::op::{Completable, CqeResult, Op};
33
use crate::runtime::CONTEXT;
44
use io_uring::{opcode, types};
55
use std::io;
6-
use std::pin::Pin;
76

87
pub(crate) struct Fsync {
98
fd: SharedFd,
109
}
1110

1211
impl Op<Fsync> {
13-
pub(crate) fn fsync(fd: &SharedFd) -> io::Result<Pin<Box<Op<Fsync>>>> {
12+
pub(crate) fn fsync(fd: &SharedFd) -> io::Result<Op<Fsync>> {
1413
CONTEXT.with(|x| {
1514
x.handle().submit_op(Fsync { fd: fd.clone() }, |fsync| {
1615
opcode::Fsync::new(types::Fd(fsync.fd.raw_fd())).build()
1716
})
1817
})
1918
}
2019

21-
pub(crate) fn datasync(fd: &SharedFd) -> io::Result<Pin<Box<Op<Fsync>>>> {
20+
pub(crate) fn datasync(fd: &SharedFd) -> io::Result<Op<Fsync>> {
2221
CONTEXT.with(|x| {
2322
x.handle().submit_op(Fsync { fd: fd.clone() }, |fsync| {
2423
opcode::Fsync::new(types::Fd(fsync.fd.raw_fd()))

src/io/mkdir_at.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use super::util::cstr;
66
use std::ffi::CString;
77
use std::io;
88
use std::path::Path;
9-
use std::pin::Pin;
109

1110
/// Create a directory at path relative to the current working directory
1211
/// of the caller's process.
@@ -16,7 +15,7 @@ pub(crate) struct Mkdir {
1615

1716
impl Op<Mkdir> {
1817
/// Submit a request to create a directory
19-
pub(crate) fn make_dir(path: &Path, mode: u32) -> io::Result<Pin<Box<Op<Mkdir>>>> {
18+
pub(crate) fn make_dir(path: &Path, mode: u32) -> io::Result<Op<Mkdir>> {
2019
use io_uring::{opcode, types};
2120

2221
let _path = cstr(path)?;

src/io/noop.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
use crate::runtime::driver::op::{Completable, CqeResult, Op};
22
use crate::runtime::CONTEXT;
33
use std::io;
4-
use std::pin::Pin;
54

65
/// No operation. Just posts a completion event, nothing else.
76
///
87
/// Has a place in benchmarking.
98
pub struct NoOp {}
109

1110
impl Op<NoOp> {
12-
pub fn no_op() -> io::Result<Pin<Box<Op<NoOp>>>> {
11+
pub fn no_op() -> io::Result<Op<NoOp>> {
1312
use io_uring::opcode;
1413

1514
CONTEXT.with(|x| {

src/io/open.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::runtime::CONTEXT;
66
use std::ffi::CString;
77
use std::io;
88
use std::path::Path;
9-
use std::pin::Pin;
109

1110
/// Open a file
1211
#[allow(dead_code)]
@@ -17,7 +16,7 @@ pub(crate) struct Open {
1716

1817
impl Op<Open> {
1918
/// Submit a request to open a file.
20-
pub(crate) fn open(path: &Path, options: &OpenOptions) -> io::Result<Pin<Box<Op<Open>>>> {
19+
pub(crate) fn open(path: &Path, options: &OpenOptions) -> io::Result<Op<Open>> {
2120
use io_uring::{opcode, types};
2221
let path = super::util::cstr(path)?;
2322
let flags = libc::O_CLOEXEC

src/io/read.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use crate::BufResult;
55
use crate::runtime::driver::op::{Completable, CqeResult, Op};
66
use crate::runtime::CONTEXT;
77
use std::io;
8-
use std::pin::Pin;
98

109
pub(crate) struct Read<T> {
1110
/// Holds a strong ref to the FD, preventing the file from being closed
@@ -18,7 +17,7 @@ pub(crate) struct Read<T> {
1817
}
1918

2019
impl<T: BoundedBufMut> Op<Read<T>> {
21-
pub(crate) fn read_at(fd: &SharedFd, buf: T, offset: u64) -> io::Result<Pin<Box<Op<Read<T>>>>> {
20+
pub(crate) fn read_at(fd: &SharedFd, buf: T, offset: u64) -> io::Result<Op<Read<T>>> {
2221
use io_uring::{opcode, types};
2322

2423
CONTEXT.with(|x| {

src/io/read_fixed.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::BufResult;
66

77
use crate::runtime::CONTEXT;
88
use std::io;
9-
use std::pin::Pin;
109

1110
pub(crate) struct ReadFixed<T> {
1211
/// Holds a strong ref to the FD, preventing the file from being closed
@@ -22,11 +21,7 @@ impl<T> Op<ReadFixed<T>>
2221
where
2322
T: BoundedBufMut<BufMut = FixedBuf>,
2423
{
25-
pub(crate) fn read_fixed_at(
26-
fd: &SharedFd,
27-
buf: T,
28-
offset: u64,
29-
) -> io::Result<Pin<Box<Op<ReadFixed<T>>>>> {
24+
pub(crate) fn read_fixed_at(fd: &SharedFd, buf: T, offset: u64) -> io::Result<Op<ReadFixed<T>>> {
3025
use io_uring::{opcode, types};
3126

3227
CONTEXT.with(|x| {

0 commit comments

Comments
 (0)