Skip to content

Commit

Permalink
Add set_flags() API to UnsubmittedOneshot.
Browse files Browse the repository at this point in the history
User can specify submission entry flags (e.g. FIXED_FILE, IO_LINK,
IO_HARDLINK) via new set_flags().
  • Loading branch information
ileixe committed Jan 30, 2024
1 parent a69d4bf commit ba8a267
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 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 @@ -37,6 +38,12 @@ impl<D, T: OneshotOutputTransform<StoredData = D>> UnsubmittedOneshot<D, T> {
}
}

/// Set the SQE's flags.
pub fn set_flags(mut self, flags: Flags) -> Self {
self.sqe = self.sqe.flags(flags);
self
}

/// Submit an operation to the driver for batched entry to the kernel.
pub fn submit(self) -> InFlightOneshot<D, T> {
let handle = CONTEXT
Expand Down

0 comments on commit ba8a267

Please sign in to comment.