@@ -26,7 +26,7 @@ use crate::{
26
26
RawWrite , ReconcileIO , ReconciliationId , RegionDefinition , ReplaceResult ,
27
27
SnapshotDetails , WorkSummary ,
28
28
} ;
29
- use crucible_common:: { BlockIndex , BlockOffset , ExtentId , NegotiationError } ;
29
+ use crucible_common:: { BlockIndex , ExtentId , NegotiationError } ;
30
30
use crucible_protocol:: WriteHeader ;
31
31
32
32
use ringbuffer:: RingBuffer ;
@@ -1510,8 +1510,7 @@ impl Downstairs {
1510
1510
1511
1511
let aread = IOop :: Read {
1512
1512
dependencies,
1513
- start_eid : ExtentId ( 0 ) ,
1514
- start_offset : BlockOffset ( 7 ) ,
1513
+ start_block : BlockIndex ( 7 ) ,
1515
1514
count : 1 ,
1516
1515
block_size : 512 ,
1517
1516
} ;
@@ -1565,25 +1564,17 @@ impl Downstairs {
1565
1564
1566
1565
// TODO: can anyone actually give us an empty write?
1567
1566
let start = blocks. start ( ) . unwrap_or ( BlockIndex ( 0 ) ) ;
1568
-
1569
- // XXX change IOop to take `BlockIndex` instead?
1570
- let extent_size = self . ddef . unwrap ( ) . extent_size ( ) . value ;
1571
- let start_eid = ExtentId ( ( start. 0 / extent_size) as u32 ) ;
1572
- let start_offset = BlockOffset ( start. 0 % extent_size) ;
1573
-
1574
1567
let awrite = if is_write_unwritten {
1575
1568
IOop :: WriteUnwritten {
1576
1569
dependencies,
1577
- start_eid,
1578
- start_offset,
1570
+ start_block : start,
1579
1571
data : write. data . freeze ( ) ,
1580
1572
blocks : write. blocks ,
1581
1573
}
1582
1574
} else {
1583
1575
IOop :: Write {
1584
1576
dependencies,
1585
- start_eid,
1586
- start_offset,
1577
+ start_block : start,
1587
1578
data : write. data . freeze ( ) ,
1588
1579
blocks : write. blocks ,
1589
1580
}
@@ -2164,16 +2155,9 @@ impl Downstairs {
2164
2155
// TODO: can anyone actually give us an empty write?
2165
2156
let start = blocks. start ( ) . unwrap_or ( BlockIndex ( 0 ) ) ;
2166
2157
let ddef = self . ddef . unwrap ( ) ;
2167
-
2168
- // XXX change IOop to take `BlockIndex` instead?
2169
- let extent_size = ddef. extent_size ( ) . value ;
2170
- let start_eid = ExtentId ( ( start. 0 / extent_size) as u32 ) ;
2171
- let start_offset = BlockOffset ( start. 0 % extent_size) ;
2172
-
2173
2158
let aread = IOop :: Read {
2174
2159
dependencies,
2175
- start_eid,
2176
- start_offset,
2160
+ start_block : start,
2177
2161
count : blocks. blocks ( ) . len ( ) as u64 ,
2178
2162
block_size : ddef. block_size ( ) ,
2179
2163
} ;
@@ -2267,7 +2251,10 @@ impl Downstairs {
2267
2251
let r = match client. should_send ( ) {
2268
2252
Ok ( r) => r,
2269
2253
Err ( ShouldSendError :: InLiveRepair ) => {
2270
- if io. send_io_live_repair ( last_repair_extent) {
2254
+ if io. send_io_live_repair (
2255
+ last_repair_extent,
2256
+ self . ddef . as_ref ( ) . unwrap ( ) ,
2257
+ ) {
2271
2258
EnqueueResult :: Send
2272
2259
} else {
2273
2260
EnqueueResult :: Skip
@@ -2320,9 +2307,6 @@ impl Downstairs {
2320
2307
2321
2308
/// Sends the given job to the given client
2322
2309
fn send ( & mut self , ds_id : JobId , io : IOop , client_id : ClientId ) {
2323
- let def = self . ddef . unwrap ( ) ;
2324
- let blocks_per_extent = def. extent_size ( ) . value ;
2325
-
2326
2310
let job = self . clients [ client_id] . prune_deps (
2327
2311
ds_id,
2328
2312
io,
@@ -2331,8 +2315,7 @@ impl Downstairs {
2331
2315
let message = match job {
2332
2316
IOop :: Write {
2333
2317
dependencies,
2334
- start_eid,
2335
- start_offset,
2318
+ start_block,
2336
2319
blocks,
2337
2320
data,
2338
2321
} => {
@@ -2343,18 +2326,14 @@ impl Downstairs {
2343
2326
session_id : self . cfg . session_id ,
2344
2327
job_id : ds_id,
2345
2328
dependencies,
2346
- start : BlockIndex (
2347
- start_eid. 0 as u64 * blocks_per_extent
2348
- + start_offset. 0 ,
2349
- ) ,
2329
+ start : start_block,
2350
2330
contexts : blocks,
2351
2331
} ,
2352
2332
data,
2353
2333
}
2354
2334
}
2355
2335
IOop :: WriteUnwritten {
2356
- start_eid,
2357
- start_offset,
2336
+ start_block,
2358
2337
blocks,
2359
2338
dependencies,
2360
2339
data,
@@ -2369,10 +2348,7 @@ impl Downstairs {
2369
2348
session_id : self . cfg . session_id ,
2370
2349
job_id : ds_id,
2371
2350
dependencies,
2372
- start : BlockIndex (
2373
- start_eid. 0 as u64 * blocks_per_extent
2374
- + start_offset. 0 ,
2375
- ) ,
2351
+ start : start_block,
2376
2352
contexts : blocks,
2377
2353
} ,
2378
2354
data,
@@ -2408,8 +2384,7 @@ impl Downstairs {
2408
2384
}
2409
2385
IOop :: Read {
2410
2386
dependencies,
2411
- start_eid,
2412
- start_offset,
2387
+ start_block,
2413
2388
count,
2414
2389
..
2415
2390
} => {
@@ -2419,9 +2394,7 @@ impl Downstairs {
2419
2394
session_id : self . cfg . session_id ,
2420
2395
job_id : ds_id,
2421
2396
dependencies,
2422
- start : BlockIndex (
2423
- start_eid. 0 as u64 * blocks_per_extent + start_offset. 0 ,
2424
- ) ,
2397
+ start : start_block,
2425
2398
count,
2426
2399
}
2427
2400
}
@@ -3544,7 +3517,7 @@ impl Downstairs {
3544
3517
fn submit_test_write_block (
3545
3518
& mut self ,
3546
3519
eid : ExtentId ,
3547
- block : BlockOffset ,
3520
+ block : crucible_common :: BlockOffset ,
3548
3521
is_write_unwritten : bool ,
3549
3522
) -> JobId {
3550
3523
let extent_size = self . ddef . unwrap ( ) . extent_size ( ) . value ;
@@ -3597,7 +3570,7 @@ impl Downstairs {
3597
3570
fn submit_read_block (
3598
3571
& mut self ,
3599
3572
eid : ExtentId ,
3600
- block : BlockOffset ,
3573
+ block : crucible_common :: BlockOffset ,
3601
3574
) -> JobId {
3602
3575
let extent_size = self . ddef . unwrap ( ) . extent_size ( ) . value ;
3603
3576
let block = BlockIndex ( u64:: from ( eid. 0 ) * extent_size + block. 0 ) ;
0 commit comments