chore: increase buffer size when wiping superblock
Increase the size of the buffer from 4K to 64K when wiping the
superblock of a replica. This decreases the time it takes to zero out
the first 8MB of a disk.
@@ -225,7 +225,7 @@ impl Lvol {
}
}
- // wipe the first MB if unmap is not supported on failure the operation
+ // wipe the first 8MB if unmap is not supported on failure the operation
// needs to be repeated
pub async fn wipe_super(&self) -> Result<(), Error> {
if !unsafe { self.0.as_ref().clear_method == LVS_CLEAR_WITH_UNMAP } {
@@ -238,7 +238,7 @@ impl Lvol {
name: self.name(),
}
})?;
- let buf = hdl.dma_malloc(1 << 12).map_err(|e| {
+ let buf = hdl.dma_malloc(1 << 16).map_err(|e| {
error!(
?self,
?e,
@@ -254,7 +254,7 @@ impl Lvol {
let range =
std::cmp::min(self.as_bdev().size_in_bytes(), (1 << 20) * 8);
debug!(?self, ?range, "zeroing range");
- for offset in 0 .. (range >> 12) {
+ for offset in 0 .. (range >> 16) {
hdl.write_at(offset * buf.len(), &buf).await.map_err(|e| {
error!(?self, ?e);
Error::RepDestroy {
