ThinDev

Struct 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
Source§

impl DmDevice<ThinDevTargetTable> for ThinDev

Source§

fn device(&self) -> Device

The device.
Source§

fn devnode(&self) -> PathBuf

The device’s device node.
Source§

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

Check if tables indicate an equivalent device.
Source§

fn name(&self) -> &DmName

The device’s name.
Source§

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

Resume I/O on the device.
Source§

fn size(&self) -> Sectors

The number of sectors available for user data.
Source§

fn table(&self) -> &ThinDevTargetTable

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 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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V