[pve-devel] [PATCH proxmox-backup-qemu] tree-wide: fix typos in comments

Fiona Ebner f.ebner at proxmox.com
Fri Jan 19 10:57:03 CET 2024


Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 header-preamble.c |  4 ++--
 src/backup.rs     |  2 +-
 src/commands.rs   |  6 +++---
 src/lib.rs        | 24 ++++++++++++------------
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/header-preamble.c b/header-preamble.c
index b44ab32..e6a6068 100644
--- a/header-preamble.c
+++ b/header-preamble.c
@@ -19,6 +19,6 @@
  * result: *mut c_int,
  * error: *mut *mut c_char,
  *
- * The callback function is called when the the async function is
- * ready. Possible errors are returned in 'error'.
+ * The callback function is called when the async function is ready.
+ * Possible errors are returned in 'error'.
  */
diff --git a/src/backup.rs b/src/backup.rs
index bbe4f00..d662520 100644
--- a/src/backup.rs
+++ b/src/backup.rs
@@ -34,7 +34,7 @@ pub(crate) struct BackupTask {
     registry: Arc<Mutex<Registry<ImageUploadInfo>>>,
     known_chunks: Arc<Mutex<HashSet<[u8; 32]>>>,
     abort: tokio::sync::broadcast::Sender<()>,
-    aborted: OnceCell<String>, // set on abort, conatins abort reason
+    aborted: OnceCell<String>, // set on abort, contains abort reason
 }
 
 impl BackupTask {
diff --git a/src/commands.rs b/src/commands.rs
index 37d653c..ba1832f 100644
--- a/src/commands.rs
+++ b/src/commands.rs
@@ -58,7 +58,7 @@ pub(crate) fn deserialize_state(data: &[u8]) -> Result<(), Error> {
     Ok(())
 }
 
-// Note: We alway register/upload a chunk containing zeros
+// Note: We always register/upload a chunk containing zeros
 async fn register_zero_chunk(
     client: Arc<BackupWriter>,
     crypt_config: Option<Arc<CryptConfig>>,
@@ -439,7 +439,7 @@ pub(crate) async fn write_data(
 
     match upload_queue {
         Some(ref mut upload_queue) => {
-            // Phase 2: send reponse future to other task
+            // Phase 2: send response future to other task
             if upload_queue.send(upload_future).await.is_err() {
                 let upload_result = {
                     let mut guard = registry.lock().unwrap();
@@ -463,7 +463,7 @@ pub(crate) async fn write_data(
         }
     }
 
-    //println!("upload chunk sucessful");
+    //println!("upload chunk successful");
 
     Ok(if reused { 0 } else { size as c_int })
 }
diff --git a/src/lib.rs b/src/lib.rs
index 02e74f7..3b0c1fa 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -98,7 +98,7 @@ macro_rules! param_not_null {
 
 /// Returns the text presentation (relative path) for a backup snapshot
 ///
-/// The resturned value is allocated with strdup(), and can be freed
+/// The returned value is allocated with strdup(), and can be freed
 /// with free().
 #[no_mangle]
 #[allow(clippy::not_unsafe_ptr_arg_deref)]
@@ -142,7 +142,7 @@ pub(crate) struct BackupSetup {
     pub fingerprint: Option<String>,
 }
 
-// helper class to implement synchrounous interface
+// helper class to implement synchronous interface
 struct GotResultCondition {
     lock: Mutex<bool>,
     cond: Condvar,
@@ -327,7 +327,7 @@ fn backup_handle_to_task(handle: *mut ProxmoxBackupHandle) -> Arc<BackupTask> {
 /// Open connection to the backup server (sync)
 ///
 /// Returns:
-///  0 ... Sucecss (no prevbious backup)
+///  0 ... Success (no previous backup)
 ///  1 ... Success (found previous backup)
 /// -1 ... Error
 #[no_mangle]
@@ -358,7 +358,7 @@ pub extern "C" fn proxmox_backup_connect(
 /// Open connection to the backup server
 ///
 /// Returns:
-///  0 ... Sucecss (no prevbious backup)
+///  0 ... Success (no previous backup)
 ///  1 ... Success (found previous backup)
 /// -1 ... Error
 #[no_mangle]
@@ -565,7 +565,7 @@ pub extern "C" fn proxmox_backup_add_config_async(
 ///
 /// Returns:
 /// -1: on error
-///  0: successful, chunk already exists on server, so it was resued
+///  0: successful, chunk already exists on server, so it was reused
 ///  size: successful, chunk uploaded
 #[no_mangle]
 #[allow(clippy::not_unsafe_ptr_arg_deref)]
@@ -608,11 +608,11 @@ pub extern "C" fn proxmox_backup_write_data(
 /// (only allowed if size == chunk_size)
 ///
 /// Note: The data pointer needs to be valid until the async
-/// opteration is finished.
+/// operation is finished.
 ///
 /// Returns:
 /// -1: on error
-///  0: successful, chunk already exists on server, so it was resued
+///  0: successful, chunk already exists on server, so it was reused
 ///  size: successful, chunk uploaded
 #[no_mangle]
 #[allow(clippy::not_unsafe_ptr_arg_deref)]
@@ -772,7 +772,7 @@ fn restore_handle_to_task(handle: *mut ProxmoxRestoreHandle) -> Arc<RestoreTask>
     Arc::clone(restore_task)
 }
 
-/// DEPRECATED: Connect the the backup server for restore (sync)
+/// DEPRECATED: Connect to the backup server for restore (sync)
 ///
 /// Deprecated in favor of `proxmox_restore_new_ns` which includes a namespace parameter.
 /// Also, it used "lossy" utf8 decoding on the snapshot name which is not the case in the new
@@ -830,7 +830,7 @@ pub extern "C" fn proxmox_restore_new(
     }
 }
 
-/// Connect the the backup server for restore (sync)
+/// Connect to the backup server for restore (sync)
 #[no_mangle]
 #[allow(clippy::not_unsafe_ptr_arg_deref)]
 pub extern "C" fn proxmox_restore_new_ns(
@@ -893,7 +893,7 @@ pub extern "C" fn proxmox_restore_new_ns(
 /// Open connection to the backup server (sync)
 ///
 /// Returns:
-///  0 ... Sucecss (no prevbious backup)
+///  0 ... Success (no previous backup)
 /// -1 ... Error
 #[no_mangle]
 #[allow(clippy::not_unsafe_ptr_arg_deref)]
@@ -922,7 +922,7 @@ pub extern "C" fn proxmox_restore_connect(
 /// Open connection to the backup server (async)
 ///
 /// Returns:
-///  0 ... Sucecss (no prevbious backup)
+///  0 ... Success (no previous backup)
 /// -1 ... Error
 #[no_mangle]
 #[allow(clippy::not_unsafe_ptr_arg_deref)]
@@ -1125,7 +1125,7 @@ pub extern "C" fn proxmox_restore_read_image_at(
 /// of file).
 ///
 /// Note: The data pointer needs to be valid until the async
-/// opteration is finished.
+/// operation is finished.
 ///
 /// Note: The call will only ever transfer less than 'size' bytes if
 /// the end of the file has been reached.
-- 
2.39.2





More information about the pve-devel mailing list