aboutsummaryrefslogtreecommitdiff
path: root/src/block/layout.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-09-07 13:44:11 +0200
committerAlex Auvolat <alex@adnab.me>2023-09-07 13:44:11 +0200
commit6b008b5bd3843bb236f94a1b4472de11f5755f04 (patch)
treef9d2afe0e7a21b07bfa0f0e94a607a695f516e65 /src/block/layout.rs
parent6595efd82fc849c97b964969b6ff935738e7d24a (diff)
downloadgarage-6b008b5bd3843bb236f94a1b4472de11f5755f04.tar.gz
garage-6b008b5bd3843bb236f94a1b4472de11f5755f04.zip
block manager: add rebalance operation to rebalance multi-hdd setups
Diffstat (limited to 'src/block/layout.rs')
-rw-r--r--src/block/layout.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/block/layout.rs b/src/block/layout.rs
index 8098654f..e32ef785 100644
--- a/src/block/layout.rs
+++ b/src/block/layout.rs
@@ -252,6 +252,14 @@ impl DataLayout {
path.push(hex::encode(&hash.as_slice()[1..2]));
path
}
+
+ pub(crate) fn without_secondary_locations(&self) -> Self {
+ Self {
+ data_dirs: self.data_dirs.clone(),
+ part_prim: self.part_prim.clone(),
+ part_sec: self.part_sec.iter().map(|_| vec![]).collect::<Vec<_>>(),
+ }
+ }
}
impl InitialFormat for DataLayout {