Skip to content

Commit

Permalink
Round up to the nearest eight sectors
Browse files Browse the repository at this point in the history
!4095 instead of !4096.

Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Aug 12, 2024
1 parent c982618 commit 5f95a26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/engine/strat_engine/backstore/blockdev/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ use crate::{
/// This is a slight overestimation for the sake of simplicity. Because it uses the whole disk
/// size, once the integrity metadata size is calculated, the remaining data size is now smaller
/// than the metadata region could support for integrity.
/// The result is divisible by 8 sectors.
pub fn integrity_meta_space(total_space: Sectors) -> Sectors {
Bytes(4096).sectors()
+ Bytes::from(64 * IEC::Mi).sectors()
+ Bytes::from((*total_space * 32u64 + 4095) & !4096).sectors()
+ Bytes::from((*total_space * 32u64 + 4095) & !4095).sectors()
}

/// Return the amount of space required for RAID for a device of the given size.
Expand Down

0 comments on commit 5f95a26

Please sign in to comment.