Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add support for flags in function write_at #305

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/runtime/driver/op/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::marker::PhantomData;
use std::pin::Pin;
use std::task::{Context, Poll, Waker};

use io_uring::squeue::Flags;
use io_uring::{cqueue, squeue};

mod slab_list;
Expand Down Expand Up @@ -60,6 +61,16 @@ impl<D, T: OneshotOutputTransform<StoredData = D>> UnsubmittedOneshot<D, T> {

InFlightOneshot { inner: Some(inner) }
}

/// Set flags on unsubmitted entry
///
/// # Safety
///
/// Flags can change logic of operation. Use it only if you now what flags do
pub unsafe fn set_flags(mut self, flags: Flags) -> Self {
self.sqe = self.sqe.flags(flags);
self
}
}

/// An in-progress oneshot operation which can be polled for completion.
Expand Down