Skip to content

Commit 2c836db

Browse files
committed
Remove the last stack allocated block.
Must have missed this before.
1 parent 1b9fa5c commit 2c836db

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/fat/volume.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,15 +1029,12 @@ impl FatVolume {
10291029
*number_free_cluster -= 1;
10301030
};
10311031
if zero {
1032-
let blocks = [Block::new()];
10331032
let start_block_idx = self.cluster_to_block(new_cluster);
10341033
let num_blocks = BlockCount(u32::from(self.blocks_per_cluster));
10351034
for block_idx in start_block_idx.range(num_blocks) {
1036-
trace!("Zeroing cluster");
1037-
block_cache
1038-
.block_device()
1039-
.write(&blocks, block_idx)
1040-
.map_err(Error::DeviceError)?;
1035+
trace!("Zeroing cluster {:?}", block_idx);
1036+
let _block = block_cache.blank_mut(block_idx);
1037+
block_cache.write_back()?;
10411038
}
10421039
}
10431040
debug!("All done, returning {:?}", new_cluster);

0 commit comments

Comments
 (0)