@@ -202,12 +202,22 @@ impl GuestWork {
202
202
( gw_id, ds_id)
203
203
}
204
204
205
+ /// Low-level function to get next guest work ID
206
+ ///
207
+ /// Normally, `submit_job` should be called instead; this function should
208
+ /// only be used to reserve `GuestWorkId`s in advance of submitting the
209
+ /// jobs.
205
210
pub ( crate ) fn next_gw_id ( & mut self ) -> GuestWorkId {
206
211
let id = self . next_gw_id ;
207
212
self . next_gw_id += 1 ;
208
213
GuestWorkId ( id)
209
214
}
210
215
216
+ /// Low-level function to insert work into the map
217
+ ///
218
+ /// Normally, `submit_job` should be called instead; this function should
219
+ /// only be used if we have reserved the `GuestWorkId` and `JobId` in
220
+ /// advance.
211
221
pub ( crate ) fn insert (
212
222
& mut self ,
213
223
gw_id : GuestWorkId ,
@@ -536,7 +546,7 @@ impl BlockIO for Guest {
536
546
}
537
547
538
548
async fn get_block_size ( & self ) -> Result < u64 , CrucibleError > {
539
- let bs = self . block_size . load ( std :: sync :: atomic :: Ordering :: Relaxed ) ;
549
+ let bs = self . block_size . load ( Ordering :: Relaxed ) ;
540
550
if bs == 0 {
541
551
let data = Arc :: new ( Mutex :: new ( 0 ) ) ;
542
552
let size_query = BlockOp :: QueryBlockSize { data : data. clone ( ) } ;
@@ -546,8 +556,7 @@ impl BlockIO for Guest {
546
556
reply. result ?;
547
557
548
558
let bs = * data. lock ( ) . await ;
549
- self . block_size
550
- . store ( bs, std:: sync:: atomic:: Ordering :: Relaxed ) ;
559
+ self . block_size . store ( bs, Ordering :: Relaxed ) ;
551
560
Ok ( bs)
552
561
} else {
553
562
Ok ( bs)
@@ -945,8 +954,7 @@ impl GuestIoHandle {
945
954
946
955
/// Looks up current backpressure
947
956
pub fn backpressure_us ( & self ) -> u64 {
948
- self . backpressure_us
949
- . load ( std:: sync:: atomic:: Ordering :: Acquire )
957
+ self . backpressure_us . load ( Ordering :: Acquire )
950
958
}
951
959
952
960
/// Debug function to dump the guest work structure.
0 commit comments