Struct devicemapper::ThinDev

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

DM construct for a thin block device

Implementations§

source§

impl ThinDev

support use of DM for thin provisioned devices over pools

source

pub fn new( dm: &DM, name: &DmName, uuid: Option<&DmUuid>, length: Sectors, thin_pool: &ThinPoolDev, thin_id: ThinDevId ) -> DmResult<ThinDev>

Create a ThinDev using thin_pool as the backing store. If the specified thin_id is already in use by the thin pool an error is returned. If the device is already among the list of devices that dm is aware of, return an error.

source

pub fn setup( dm: &DM, name: &DmName, uuid: Option<&DmUuid>, length: Sectors, thin_pool: &ThinPoolDev, thin_id: ThinDevId ) -> DmResult<ThinDev>

Set up a thin device which already belongs to the given thin_pool. The thin device is identified by the thin_id, which is already known to the pool.

If the device is already known to kernel, just verify that specified data matches and return an error if it does not.

If the device has no thin id already registered with the thin pool an error is returned.

source

pub fn snapshot( &self, dm: &DM, snapshot_name: &DmName, snapshot_uuid: Option<&DmUuid>, thin_pool: &ThinPoolDev, snapshot_thin_id: ThinDevId ) -> DmResult<ThinDev>

Create a snapshot of a ThinDev. Once created a snapshot is the same as any other thin provisioned device. There is no need to track any connection between the source and the snapshot.

source

pub fn id(&self) -> ThinDevId

return the thin id of the linear device

source

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

Get the current status of the thin device.

source

pub fn set_table( &mut self, dm: &DM, table: TargetLine<ThinTargetParams> ) -> DmResult<()>

Set the table for the thin device’s target

source

pub fn destroy(&mut self, dm: &DM, thin_pool: &ThinPoolDev) -> DmResult<()>

Tear down the DM device, and also delete resources associated with its thin id from the thinpool.

Trait Implementations§

source§

impl Debug for ThinDev

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