Struct devicemapper::CacheDev

source ·
pub struct CacheDev { /* private fields */ }
Expand description

DM Cache device

Implementations§

source§

impl CacheDev

Cache device implementation.

source

pub fn new( dm: &DM, name: &DmName, uuid: Option<&DmUuid>, meta: LinearDev, cache: LinearDev, origin: LinearDev, cache_block_size: Sectors ) -> DmResult<CacheDev>

Construct a new CacheDev with the given data and meta devs. Returns an error if the device is already known to the kernel.

source

pub fn setup( dm: &DM, name: &DmName, uuid: Option<&DmUuid>, meta: LinearDev, cache: LinearDev, origin: LinearDev, cache_block_size: Sectors ) -> DmResult<CacheDev>

Set up a cache device from the given metadata and data devices.

source

pub fn set_origin_table( &mut self, dm: &DM, table: Vec<TargetLine<LinearDevTargetParams>> ) -> DmResult<()>

Set the table for the existing origin device. This action puts the device in a state where it is ready to be resumed. Warning: It is the client’s responsibility to make sure the designated table is compatible with the device’s existing table. If not, this function will still succeed, but some kind of data corruption will be the inevitable result.

source

pub fn set_cache_table( &mut self, dm: &DM, table: Vec<TargetLine<LinearDevTargetParams>> ) -> DmResult<()>

Set the table for the existing cache sub-device. This action puts the device in a state where it is ready to be resumed. Warning: It is the client’s responsibility to make sure the designated table is compatible with the device’s existing table. If not, this function will still succeed, but some kind of data corruption will be the inevitable result.

source

pub fn set_meta_table( &mut self, dm: &DM, table: Vec<TargetLine<LinearDevTargetParams>> ) -> DmResult<()>

Set the table for the existing meta sub-device. This action puts the device in a state where it is ready to be resumed. Warning: It is the client’s responsibility to make sure the designated table is compatible with the device’s existing table. If not, this function will still succeed, but some kind of data corruption will be the inevitable result.

source

pub fn status(&self, dm: &DM, options: DmOptions) -> DmResult<CacheDevStatus>

Get the current status of the cache device.

Trait Implementations§

source§

impl Debug for CacheDev

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V