]> git.proxmox.com Git - proxmox-backup.git/commitdiff
tape: improve function naming
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 22 Jan 2024 11:50:26 +0000 (12:50 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 22 Jan 2024 12:07:13 +0000 (13:07 +0100)
rename the inner 'set_encryption' in sg_tape to drive_set_encryption,
so that it's a bit clearer where it comes from.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
pbs-tape/src/sg_tape.rs
pbs-tape/src/sg_tape/encryption.rs

index 53fe78fa8f82e485cea28aae8348be5af694a9ac..0417a088d9fe17733aee1412ae30909639edd910 100644 (file)
@@ -9,7 +9,7 @@ use endian_trait::Endian;
 use nix::fcntl::{fcntl, FcntlArg, OFlag};
 
 mod encryption;
-pub use encryption::*;
+pub use encryption::{drive_set_encryption, has_encryption};
 
 mod volume_statistics;
 pub use volume_statistics::*;
@@ -615,7 +615,7 @@ impl SgTape {
     pub fn set_encryption(&mut self, key: Option<[u8; 32]>) -> Result<(), Error> {
         self.encryption_key_loaded = key.is_some();
 
-        set_encryption(&mut self.file, key)
+        drive_set_encryption(&mut self.file, key)
     }
 
     // Note: use alloc_page_aligned_buffer to alloc data transfer buffer
index 58407305480ce083c511e40fabca003f8e4d3a84..59648954d6e1d456f7d5ae3373afc1b2978eeca6 100644 (file)
@@ -22,7 +22,7 @@ pub fn has_encryption<F: AsRawFd>(file: &mut F) -> bool {
 /// Set or clear encryption key
 ///
 /// We always use mixed mode,
-pub fn set_encryption<F: AsRawFd>(file: &mut F, key: Option<[u8; 32]>) -> Result<(), Error> {
+pub fn drive_set_encryption<F: AsRawFd>(file: &mut F, key: Option<[u8; 32]>) -> Result<(), Error> {
     let data = match sg_spin_data_encryption_caps(file) {
         Ok(data) => data,
         Err(_) if key.is_none() => {