File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ const DEFRAGMENT_THRESHOLD: u64 = 3;
54
54
/// serialized using `bincode`.
55
55
/// - Active context slots, stored as a bit-packed array (where 0 is
56
56
/// [`ContextSlot::A`] and 1 is [`ContextSlot::B`]). This array contains
57
- /// `( extent_size + 7) / 8 ` bytes. It is only valid when the `dirty` bit is
57
+ /// `extent_size.div_ceil(8) ` bytes. It is only valid when the `dirty` bit is
58
58
/// cleared. This is an optimization that speeds up opening a clean extent
59
59
/// file; otherwise, we would have to rehash every block to find the active
60
60
/// context slot.
@@ -1147,7 +1147,7 @@ impl RawLayout {
1147
1147
let block_count = self . block_count ( ) ;
1148
1148
self . block_size ( ) . checked_mul ( block_count) . unwrap ( )
1149
1149
+ BLOCK_META_SIZE_BYTES
1150
- + ( block_count + 7 ) / 8
1150
+ + block_count. div_ceil ( 8 )
1151
1151
+ BLOCK_CONTEXT_SLOT_SIZE_BYTES * block_count * 2
1152
1152
}
1153
1153
@@ -1180,7 +1180,7 @@ impl RawLayout {
1180
1180
}
1181
1181
1182
1182
fn active_context_size ( & self ) -> u64 {
1183
- ( self . block_count ( ) + 7 ) / 8
1183
+ self . block_count ( ) . div_ceil ( 8 )
1184
1184
}
1185
1185
1186
1186
fn metadata_offset ( & self ) -> u64 {
You can’t perform that action at this time.
0 commit comments