forked from proxmox-mirrors/proxmox-backup
tape: improve function naming
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>
(cherry picked from commit 8cc8aa510f)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
dc051f2e30
commit
e2d129f9de
@ -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::*;
|
||||
@ -606,7 +606,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
|
||||
|
||||
@ -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() => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user