typo fixes all over the place

found and semi-manually replaced by using:
 codespell -L mut -L crate -i 3 -w

Mostly in comments, but also email notification and two occurrences
of misspelled  'reserved' struct member, which where not used and
cargo build did not complain about the change, soo ...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2021-03-10 16:37:09 +01:00
parent 8b7f3b8f1d
commit d1d74c4367
46 changed files with 81 additions and 81 deletions

View File

@ -35,7 +35,7 @@ use crate::api2::types::{
/// Changer element status.
///
/// Drive and slots may be `Empty`, or contain some media, either
/// with knwon volume tag `VolumeTag(String)`, or without (`Full`).
/// with known volume tag `VolumeTag(String)`, or without (`Full`).
#[derive(Serialize, Deserialize, Debug)]
pub enum ElementStatus {
Empty,
@ -87,7 +87,7 @@ pub struct MtxStatus {
pub drives: Vec<DriveStatus>,
/// List of known storage slots
pub slots: Vec<StorageElementStatus>,
/// Tranport elements
/// Transport elements
///
/// Note: Some libraries do not report transport elements.
pub transports: Vec<TransportElementStatus>,
@ -261,7 +261,7 @@ pub trait MediaChange {
/// List online media labels (label_text/barcodes)
///
/// List acessible (online) label texts. This does not include
/// List accessible (online) label texts. This does not include
/// media inside import-export slots or cleaning media.
fn online_media_label_texts(&mut self) -> Result<Vec<String>, Error> {
let status = self.status()?;
@ -378,7 +378,7 @@ pub trait MediaChange {
/// Unload media to a free storage slot
///
/// If posible to the slot it was previously loaded from.
/// If possible to the slot it was previously loaded from.
///
/// Note: This method consumes status - so please use returned status afterward.
fn unload_to_free_slot(&mut self, status: MtxStatus) -> Result<MtxStatus, Error> {

View File

@ -1,4 +1,4 @@
//! Wrapper around expernal `mtx` command line tool
//! Wrapper around external `mtx` command line tool
mod parse_mtx_status;
pub use parse_mtx_status::*;

View File

@ -246,7 +246,7 @@ pub fn unload(
Ok(())
}
/// Tranfer medium from one storage slot to another
/// Transfer medium from one storage slot to another
pub fn transfer_medium<F: AsRawFd>(
file: &mut F,
from_slot: u64,
@ -362,7 +362,7 @@ pub fn read_element_status<F: AsRawFd>(file: &mut F) -> Result<MtxStatus, Error>
bail!("got wrong number of import/export elements");
}
if (setup.transfer_element_count as usize) != drives.len() {
bail!("got wrong number of tranfer elements");
bail!("got wrong number of transfer elements");
}
// create same virtual slot order as mtx(1)
@ -428,7 +428,7 @@ struct SubHeader {
element_type_code: u8,
flags: u8,
descriptor_length: u16,
reseved: u8,
reserved: u8,
byte_count_of_descriptor_data_available: [u8;3],
}

View File

@ -196,7 +196,7 @@ struct SspDataEncryptionCapabilityPage {
page_code: u16,
page_len: u16,
extdecc_cfgp_byte: u8,
reserverd: [u8; 15],
reserved: [u8; 15],
}
#[derive(Endian)]
@ -241,13 +241,13 @@ fn decode_spin_data_encryption_caps(data: &[u8]) -> Result<u8, Error> {
let desc: SspDataEncryptionAlgorithmDescriptor =
unsafe { reader.read_be_value()? };
if desc.descriptor_len != 0x14 {
bail!("got wrong key descriptior len");
bail!("got wrong key descriptor len");
}
if (desc.control_byte_4 & 0b00000011) != 2 {
continue; // cant encrypt in hardware
continue; // can't encrypt in hardware
}
if ((desc.control_byte_4 & 0b00001100) >> 2) != 2 {
continue; // cant decrypt in hardware
continue; // can't decrypt in hardware
}
if desc.algorithm_code == 0x00010014 && desc.key_size == 32 {
aes_cgm_index = Some(desc.algorythm_index);
@ -276,7 +276,7 @@ struct SspDataEncryptionStatusPage {
control_byte: u8,
key_format: u8,
key_len: u16,
reserverd: [u8; 8],
reserved: [u8; 8],
}
fn decode_spin_data_encryption_status(data: &[u8]) -> Result<DataEncryptionStatus, Error> {

View File

@ -72,14 +72,14 @@ static MAM_ATTRIBUTES: &[ (u16, u16, MamFormat, &str) ] = &[
(0x08_02, 8, MamFormat::ASCII, "Application Version"),
(0x08_03, 160, MamFormat::ASCII, "User Medium Text Label"),
(0x08_04, 12, MamFormat::ASCII, "Date And Time Last Written"),
(0x08_05, 1, MamFormat::BINARY, "Text Localization Identifer"),
(0x08_05, 1, MamFormat::BINARY, "Text Localization Identifier"),
(0x08_06, 32, MamFormat::ASCII, "Barcode"),
(0x08_07, 80, MamFormat::ASCII, "Owning Host Textual Name"),
(0x08_08, 160, MamFormat::ASCII, "Media Pool"),
(0x08_0B, 16, MamFormat::ASCII, "Application Format Version"),
(0x08_0C, 50, MamFormat::ASCII, "Volume Coherency Information"),
(0x08_20, 36, MamFormat::ASCII, "Medium Globally Unique Identifer"),
(0x08_21, 36, MamFormat::ASCII, "Media Pool Globally Unique Identifer"),
(0x08_20, 36, MamFormat::ASCII, "Medium Globally Unique Identifier"),
(0x08_21, 36, MamFormat::ASCII, "Media Pool Globally Unique Identifier"),
(0x10_00, 28, MamFormat::BINARY, "Unique Cartridge Identify (UCI)"),
(0x10_01, 24, MamFormat::BINARY, "Alternate Unique Cartridge Identify (Alt-UCI)"),

View File

@ -209,7 +209,7 @@ pub trait TapeDriver {
/// Set or clear encryption key
///
/// We use the media_set_uuid to XOR the secret key with the
/// uuid (first 16 bytes), so that each media set uses an uique
/// uuid (first 16 bytes), so that each media set uses an unique
/// key for encryption.
fn set_encryption(
&mut self,
@ -465,7 +465,7 @@ pub fn request_and_load_media(
}
}
/// Aquires an exclusive lock for the tape device
/// Acquires an exclusive lock for the tape device
///
/// Basically calls lock_device_path() using the configured drive path.
pub fn lock_tape_device(
@ -539,7 +539,7 @@ fn tape_device_path(
pub struct DeviceLockGuard(std::fs::File);
// Aquires an exclusive lock on `device_path`
// Acquires an exclusive lock on `device_path`
//
// Uses systemd escape_unit to compute a file name from `device_path`, the try
// to lock `/var/lock/<name>`.

View File

@ -429,7 +429,7 @@ impl MediaChange for VirtualTapeHandle {
}
fn transfer_media(&mut self, _from: u64, _to: u64) -> Result<MtxStatus, Error> {
bail!("media tranfer is not implemented!");
bail!("media transfer is not implemented!");
}
fn export_media(&mut self, _label_text: &str) -> Result<Option<u64>, Error> {

View File

@ -77,7 +77,7 @@ impl <R: Read> BlockedReader<R> {
if seq_nr != buffer.seq_nr() {
proxmox::io_bail!(
"detected tape block with wrong seqence number ({} != {})",
"detected tape block with wrong sequence number ({} != {})",
seq_nr, buffer.seq_nr())
}

View File

@ -25,7 +25,7 @@ use crate::tape::{
///
/// A chunk archive consists of a `MediaContentHeader` followed by a
/// list of chunks entries. Each chunk entry consists of a
/// `ChunkArchiveEntryHeader` folowed by the chunk data (`DataBlob`).
/// `ChunkArchiveEntryHeader` followed by the chunk data (`DataBlob`).
///
/// `| MediaContentHeader | ( ChunkArchiveEntryHeader | DataBlob )* |`
pub struct ChunkArchiveWriter<'a> {
@ -153,7 +153,7 @@ impl <R: Read> ChunkArchiveDecoder<R> {
Self { reader }
}
/// Allow access to the underyling reader
/// Allow access to the underlying reader
pub fn reader(&self) -> &R {
&self.reader
}

View File

@ -21,7 +21,7 @@ use crate::tape::{
///
/// This ignores file attributes like ACLs and xattrs.
///
/// Returns `Ok(Some(content_uuid))` on succees, and `Ok(None)` if
/// Returns `Ok(Some(content_uuid))` on success, and `Ok(None)` if
/// `LEOM` was detected before all data was written. The stream is
/// marked inclomplete in that case and does not contain all data (The
/// backup task must rewrite the whole file on the next media).

View File

@ -85,7 +85,7 @@ impl SnapshotReader {
Ok(file)
}
/// Retunrs an iterator for all used chunks.
/// Returns an iterator for all used chunks.
pub fn chunk_iterator(&self) -> Result<SnapshotChunkIterator, Error> {
SnapshotChunkIterator::new(&self)
}

View File

@ -561,7 +561,7 @@ impl Inventory {
// Helpers to simplify testing
/// Genreate and insert a new free tape (test helper)
/// Generate and insert a new free tape (test helper)
pub fn generate_free_tape(&mut self, label_text: &str, ctime: i64) -> Uuid {
let label = MediaLabel {
@ -576,7 +576,7 @@ impl Inventory {
uuid
}
/// Genreate and insert a new tape assigned to a specific pool
/// Generate and insert a new tape assigned to a specific pool
/// (test helper)
pub fn generate_assigned_tape(
&mut self,
@ -600,7 +600,7 @@ impl Inventory {
uuid
}
/// Genreate and insert a used tape (test helper)
/// Generate and insert a used tape (test helper)
pub fn generate_used_tape(
&mut self,
label_text: &str,

View File

@ -3,7 +3,7 @@
//! A set of backup medias.
//!
//! This struct manages backup media state during backup. The main
//! purpose is to allocate media sets and assing new tapes to it.
//! purpose is to allocate media sets and assign new tapes to it.
//!
//!
@ -137,7 +137,7 @@ impl MediaPool {
&self.name
}
/// Retruns encryption settings
/// Returns encryption settings
pub fn encrypt_fingerprint(&self) -> Option<Fingerprint> {
self.encrypt_fingerprint.clone()
}
@ -286,7 +286,7 @@ impl MediaPool {
Ok(list)
}
// tests if the media data is considered as expired at sepcified time
// tests if the media data is considered as expired at specified time
pub fn media_is_expired(&self, media: &BackupMedia, current_time: i64) -> bool {
if media.status() != &MediaStatus::Full {
return false;

View File

@ -48,7 +48,7 @@ impl MediaSet {
let seq_nr = seq_nr as usize;
if self.media_list.len() > seq_nr {
if self.media_list[seq_nr].is_some() {
bail!("found duplicate squence number in media set '{}/{}'",
bail!("found duplicate sequence number in media set '{}/{}'",
self.uuid.to_string(), seq_nr);
}
} else {

View File

@ -271,7 +271,7 @@ impl PoolWriter {
}
}
/// Move to EOM (if not aleady there), then creates a new snapshot
/// Move to EOM (if not already there), then creates a new snapshot
/// archive writing specified files (as .pxar) into it. On
/// success, this return 'Ok(true)' and the media catalog gets
/// updated.
@ -330,7 +330,7 @@ impl PoolWriter {
Ok((done, bytes_written))
}
/// Move to EOM (if not aleady there), then creates a new chunk
/// Move to EOM (if not already there), then creates a new chunk
/// archive and writes chunks from 'chunk_iter'. This stops when
/// it detect LEOM or when we reach max archive size
/// (4GB). Written chunks are registered in the media catalog.

View File

@ -67,7 +67,7 @@ pub trait TapeWrite {
///
/// See: https://github.com/torvalds/linux/blob/master/Documentation/scsi/st.rst
///
/// On sucess, this returns if we en countered a EOM condition.
/// On success, this returns if we en countered a EOM condition.
pub fn tape_device_write_block<W: Write>(
writer: &mut W,
data: &[u8],

View File

@ -173,7 +173,7 @@ fn test_alloc_writable_media_4() -> Result<(), Error> {
// next call fail because there is no free media
assert!(pool.alloc_writable_media(start_time + 5).is_err());
// Create new nedia set, so that previous set can expire
// Create new media set, so that previous set can expire
pool.start_write_session(start_time + 10)?;
assert!(pool.alloc_writable_media(start_time + 10).is_err());