@@ -22,6 +22,7 @@ use io_uring::IoUring;
2222
2323use crate :: completion:: SubmissionRecordStatus ;
2424use crate :: fixed:: FixedFdRegister ;
25+ use crate :: SubmissionFlags ;
2526
2627use crate :: slab:: BuffersRec ;
2728use crate :: slab:: FutexRec ;
@@ -177,34 +178,52 @@ impl<C: core::fmt::Debug + Clone + OpCompletion> UringBearer<C> {
177178 . map_err ( |e| UringBearerError :: Submission ( e. to_string ( ) ) )
178179 }
179180 /// Push a general Op implementing OpCode trait (see io-uring-opcode)
180- pub fn push_op < Op : OpCode < C > > ( & mut self , op : Op ) -> Result < usize , UringBearerError > {
181+ pub fn push_op < Op : OpCode < C > > (
182+ & mut self ,
183+ op : Op ,
184+ flags : Option < SubmissionFlags > ,
185+ ) -> Result < usize , UringBearerError > {
181186 let key = self
182187 . fd_slab
183188 . take_next_with ( Completion :: Op ( op. submission ( ) ?) )
184189 . map_err ( UringBearerError :: Slabbable ) ?;
185190
186- match self . _push_to_completion ( key) {
191+ match self . _push_to_completion ( key, flags ) {
187192 Err ( e) => Err ( e) ,
188193 Ok ( ( ) ) => Ok ( key) ,
189194 }
190195 }
191196 /// Push a pending typed Completion directly
192- pub fn push_op_typed ( & mut self , op : Completion < C > ) -> Result < usize , UringBearerError > {
197+ pub fn push_op_typed (
198+ & mut self ,
199+ op : Completion < C > ,
200+ flags : Option < SubmissionFlags > ,
201+ ) -> Result < usize , UringBearerError > {
193202 let key = self
194203 . fd_slab
195204 . take_next_with ( op)
196205 . map_err ( UringBearerError :: Slabbable ) ?;
197206
198- match self . _push_to_completion ( key) {
207+ match self . _push_to_completion ( key, flags ) {
199208 Err ( e) => Err ( e) ,
200209 Ok ( ( ) ) => Ok ( key) ,
201210 }
202211 }
203212 #[ inline]
204- pub ( crate ) fn _push_to_completion ( & mut self , idx : usize ) -> Result < ( ) , UringBearerError > {
213+ pub ( crate ) fn _push_to_completion (
214+ & mut self ,
215+ idx : usize ,
216+ in_flags : Option < SubmissionFlags > ,
217+ ) -> Result < ( ) , UringBearerError > {
205218 let iou = & mut self . io_uring ;
206219 let mut s_queue = iou. submission ( ) ;
207220
221+ let flags = match in_flags {
222+ None => SubmissionFlags :: default ( ) ,
223+ Some ( fl) => fl,
224+ }
225+ . to_io_uring_flags ( ) ?;
226+
208227 let completion_rec = self
209228 . fd_slab
210229 . slot_get_mut ( idx)
@@ -216,7 +235,7 @@ impl<C: core::fmt::Debug + Clone + OpCompletion> UringBearer<C> {
216235 return Err ( UringBearerError :: InvalidOwnership ( completion. owner ( ) , idx) ) ;
217236 }
218237 completion. force_owner_kernel ( ) ;
219- completion. entry ( ) . user_data ( idx as u64 )
238+ completion. entry ( ) . flags ( flags ) . user_data ( idx as u64 )
220239 }
221240 _ => return Err ( UringBearerError :: SlabBugSetGet ( "Submisison not found?" ) ) ,
222241 } ;
0 commit comments