tape: cleanup: s/transfer/transfer_media/, avoid compiler warnings

This commit is contained in:
Dietmar Maurer 2021-01-10 12:18:30 +01:00
parent edb90f6afa
commit c92e3832bf
4 changed files with 8 additions and 8 deletions

View File

@ -21,7 +21,7 @@ pub trait MediaChange {
/// Transfer media from on slot to another (storage or import export slots)
///
/// Target slot needs to be empty
fn transfer(&mut self, from: u64, to: u64) -> Result<(), Error>;
fn transfer_media(&mut self, from: u64, to: u64) -> Result<(), Error>;
/// Load media from storage slot into drive
fn load_media_from_slot(&mut self, slot: u64) -> Result<(), Error>;
@ -102,10 +102,10 @@ pub trait MediaChange {
}
match (from, to) {
(Some(from), Some(to)) => {
self.transfer(from, to);
self.transfer_media(from, to)?;
Ok(Some(to))
}
(Some(from), None) => bail!("unable to find free export slot"),
(Some(_from), None) => bail!("unable to find free export slot"),
(None, _) => Ok(None), // not online
}
}

View File

@ -72,7 +72,7 @@ impl MediaChange for MtxMediaChanger {
mtx_status(&self.config)
}
fn transfer(&mut self, from: u64, to: u64) -> Result<(), Error> {
fn transfer_media(&mut self, from: u64, to: u64) -> Result<(), Error> {
mtx_transfer(&self.config.path, from, to)
}

View File

@ -393,7 +393,7 @@ impl MediaChange for VirtualTapeHandle {
Ok(MtxStatus { drives, slots })
}
fn transfer(&mut self, from: u64, to: u64) -> Result<(), Error> {
fn transfer_media(&mut self, _from: u64, _to: u64) -> Result<(), Error> {
bail!("medfia tranfer is not implemented!");
}
@ -456,9 +456,9 @@ impl MediaChange for VirtualTapeDrive {
handle.status()
}
fn transfer(&mut self, from: u64, to: u64) -> Result<(), Error> {
fn transfer_media(&mut self, from: u64, to: u64) -> Result<(), Error> {
let mut handle = self.open()?;
handle.transfer(from, to)
handle.transfer_media(from, to)
}
fn load_media_from_slot(&mut self, slot: u64) -> Result<(), Error> {

View File

@ -128,7 +128,7 @@ impl PoolWriter {
/// Export current media set and drop PoolWriterState (close drive)
pub fn export_media_set(&mut self, worker: &WorkerTask) -> Result<(), Error> {
let mut status = self.status.take();
let status = self.status.take();
let (drive_config, _digest) = crate::config::drive::config()?;