Skip to content

Commit 2027b96

Browse files
committed
feat(driver): add feature gate
1 parent f9f28de commit 2027b96

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

compio-driver/src/iour/mod.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ pub(crate) use crate::unix::RawOp;
3939
pub enum OpEntry {
4040
/// This operation creates an io-uring submission entry.
4141
Submission(io_uring::squeue::Entry),
42+
#[cfg(feature = "io-uring-sqe128")]
4243
/// This operation creates an 128-bit io-uring submission entry.
4344
Submission128(io_uring::squeue::Entry128),
4445
/// This operation is a blocking one.
@@ -51,6 +52,7 @@ impl From<io_uring::squeue::Entry> for OpEntry {
5152
}
5253
}
5354

55+
#[cfg(feature = "io-uring-sqe128")]
5456
impl From<io_uring::squeue::Entry128> for OpEntry {
5557
fn from(value: io_uring::squeue::Entry128) -> Self {
5658
Self::Submission128(value)
@@ -210,19 +212,10 @@ impl Driver {
210212
.push_back(entry.user_data(user_data as _).into());
211213
Poll::Pending
212214
}
215+
#[cfg(feature = "io-uring-sqe128")]
213216
OpEntry::Submission128(_entry) => {
214-
#[cfg(feature = "io-uring-sqe128")]
215-
{
216-
self.squeue.push_back(_entry.user_data(user_data as _));
217-
Poll::Pending
218-
}
219-
#[cfg(not(feature = "io-uring-sqe128"))]
220-
{
221-
Poll::Ready(Err(io::Error::new(
222-
io::ErrorKind::Unsupported,
223-
"submission entry 128 is not enabled",
224-
)))
225-
}
217+
self.squeue.push_back(_entry.user_data(user_data as _));
218+
Poll::Pending
226219
}
227220
OpEntry::Blocking => {
228221
if self.push_blocking(user_data, op)? {

0 commit comments

Comments
 (0)