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
source§

impl DmDevice<CacheDevTargetTable> for CacheDev

source§

fn device(&self) -> Device

The device.
source§

fn devnode(&self) -> PathBuf

The device’s device node.
source§

fn equivalent_tables( left: &CacheDevTargetTable, right: &CacheDevTargetTable ) -> DmResult<bool>

Check if tables indicate an equivalent device.
source§

fn name(&self) -> &DmName

The device’s name.
source§

fn size(&self) -> Sectors

The number of sectors available for user data.
source§

fn table(&self) -> &CacheDevTargetTable

What the device thinks its table is.
source§

fn teardown(&mut self, dm: &DM) -> DmResult<()>

Erase the kernel’s memory of this device.
source§

fn uuid(&self) -> Option<&DmUuid>

The device’s UUID, if available. Note that the UUID is not any standard UUID format.
source§

fn read_kernel_table(dm: &DM, id: &DevId<'_>) -> DmResult<T>

Read the devicemapper table
source§

fn resume(&mut self, dm: &DM) -> DmResult<()>

Resume I/O on the device.
source§

fn suspend(&mut self, dm: &DM, options: DmOptions) -> DmResult<()>

Suspend I/O on the device.
source§

fn table_load(&self, dm: &DM, table: &T, options: DmOptions) -> DmResult<()>

Load a table

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