@@ -8,15 +8,16 @@ use std::{
8
8
use crate :: {
9
9
cdt,
10
10
client:: { ClientAction , ClientRequest , ClientStopReason , DownstairsClient } ,
11
+ guest:: GuestWork ,
11
12
live_repair:: ExtentInfo ,
12
13
stats:: UpStatOuter ,
13
14
upstairs:: { UpstairsConfig , UpstairsState } ,
14
15
AckStatus , ActiveJobs , AllocRingBuffer , ClientData , ClientIOStateCount ,
15
16
ClientId , ClientMap , CrucibleError , DownstairsIO , DownstairsMend , DsState ,
16
- ExtentFix , ExtentRepairIDs , GtoS , GuestWork , GuestWorkId , IOState ,
17
- IOStateCount , IOop , ImpactedBlocks , JobId , Message , RawMessage ,
18
- ReadRequest , ReadResponse , ReconcileIO , ReconciliationId , RegionDefinition ,
19
- ReplaceResult , SerializedWrite , SnapshotDetails , WorkSummary ,
17
+ ExtentFix , ExtentRepairIDs , GuestWorkId , IOState , IOStateCount , IOop ,
18
+ ImpactedBlocks , JobId , Message , RawMessage , ReadRequest , ReadResponse ,
19
+ ReconcileIO , ReconciliationId , RegionDefinition , ReplaceResult ,
20
+ SerializedWrite , SnapshotDetails , WorkSummary ,
20
21
} ;
21
22
use crucible_common:: MAX_ACTIVE_COUNT ;
22
23
@@ -1250,15 +1251,15 @@ impl Downstairs {
1250
1251
|| ( repair. aborting_repair && !have_reserved_jobs)
1251
1252
{
1252
1253
// We're done, submit a final flush!
1253
- let gw_id = gw. next_gw_id ( ) ;
1254
- cdt:: gw__flush__start!( || ( gw_id. 0 ) ) ;
1255
-
1256
- let flush_id = self . submit_flush ( gw_id, None ) ;
1254
+ let ( gw_id, flush_id) = gw. submit_job (
1255
+ |gw_id| {
1256
+ cdt:: gw__flush__start!( || ( gw_id. 0 ) ) ;
1257
+ self . submit_flush ( gw_id, None )
1258
+ } ,
1259
+ None ,
1260
+ None ,
1261
+ ) ;
1257
1262
info ! ( self . log, "LiveRepair final flush submitted" ) ;
1258
-
1259
- let new_gtos = GtoS :: new ( flush_id, None , None ) ;
1260
- gw. active . insert ( gw_id, new_gtos) ;
1261
-
1262
1263
cdt:: up__to__ds__flush__start!( || ( gw_id. 0 ) ) ;
1263
1264
1264
1265
LiveRepairState :: FinalFlush { flush_id }
@@ -1310,8 +1311,7 @@ impl Downstairs {
1310
1311
let nio = Self :: create_noop_io ( noop_id, deps, gw_noop_id) ;
1311
1312
1312
1313
cdt:: gw__noop__start!( || ( gw_noop_id. 0 ) ) ;
1313
- let new_gtos = GtoS :: new ( noop_id, None , None ) ;
1314
- gw. active . insert ( gw_noop_id, new_gtos) ;
1314
+ gw. insert ( gw_noop_id, noop_id, None , None ) ;
1315
1315
self . enqueue_repair ( nio) ;
1316
1316
}
1317
1317
@@ -1356,8 +1356,7 @@ impl Downstairs {
1356
1356
1357
1357
cdt:: gw__repair__start!( || ( gw_repair_id. 0 , eid) ) ;
1358
1358
1359
- let new_gtos = GtoS :: new ( repair_id, None , None ) ;
1360
- gw. active . insert ( gw_repair_id, new_gtos) ;
1359
+ gw. insert ( gw_repair_id, repair_id, None , None ) ;
1361
1360
self . enqueue_repair ( repair_io) ;
1362
1361
}
1363
1362
@@ -1614,8 +1613,7 @@ impl Downstairs {
1614
1613
1615
1614
cdt:: gw__reopen__start!( || ( gw_reopen_id. 0 , eid) ) ;
1616
1615
1617
- let new_gtos = GtoS :: new ( reopen_id, None , None ) ;
1618
- gw. active . insert ( gw_reopen_id, new_gtos) ;
1616
+ gw. insert ( gw_reopen_id, reopen_id, None , None ) ;
1619
1617
self . enqueue_repair ( reopen_io) ;
1620
1618
}
1621
1619
@@ -1797,8 +1795,7 @@ impl Downstairs {
1797
1795
) ;
1798
1796
1799
1797
cdt:: gw__close__start!( || ( gw_close_id. 0 , eid) ) ;
1800
- let new_gtos = GtoS :: new ( close_id, None , None ) ;
1801
- gw. active . insert ( gw_close_id, new_gtos) ;
1798
+ gw. insert ( gw_close_id, close_id, None , None ) ;
1802
1799
self . enqueue_repair ( close_io) ;
1803
1800
}
1804
1801
@@ -3548,11 +3545,12 @@ pub(crate) mod test {
3548
3545
use super :: Downstairs ;
3549
3546
use crate :: {
3550
3547
downstairs:: { LiveRepairData , LiveRepairState } ,
3548
+ guest:: GuestWork ,
3551
3549
live_repair:: ExtentInfo ,
3552
3550
upstairs:: UpstairsState ,
3553
- ClientId , CrucibleError , DownstairsIO , DsState , ExtentFix , GuestWork ,
3554
- GuestWorkId , IOState , IOop , ImpactedAddr , ImpactedBlocks , JobId ,
3555
- ReadResponse , ReconcileIO , ReconciliationId , SnapshotDetails ,
3551
+ ClientId , CrucibleError , DownstairsIO , DsState , ExtentFix , GuestWorkId ,
3552
+ IOState , IOop , ImpactedAddr , ImpactedBlocks , JobId , ReadResponse ,
3553
+ ReconcileIO , ReconciliationId , SnapshotDetails ,
3556
3554
} ;
3557
3555
use bytes:: Bytes ;
3558
3556
0 commit comments