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
impl ThinDev
support use of DM for thin provisioned devices over pools
Sourcepub fn new(
dm: &DM,
name: &DmName,
uuid: Option<&DmUuid>,
length: Sectors,
thin_pool: &ThinPoolDev,
thin_id: ThinDevId,
) -> DmResult<ThinDev>
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.
Sourcepub fn setup(
dm: &DM,
name: &DmName,
uuid: Option<&DmUuid>,
length: Sectors,
thin_pool: &ThinPoolDev,
thin_id: ThinDevId,
) -> DmResult<ThinDev>
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.
Sourcepub fn snapshot(
&self,
dm: &DM,
snapshot_name: &DmName,
snapshot_uuid: Option<&DmUuid>,
thin_pool: &ThinPoolDev,
snapshot_thin_id: ThinDevId,
) -> DmResult<ThinDev>
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.
Sourcepub fn status(&self, dm: &DM, options: DmOptions) -> DmResult<ThinStatus>
pub fn status(&self, dm: &DM, options: DmOptions) -> DmResult<ThinStatus>
Get the current status of the thin device.
Sourcepub fn set_table(
&mut self,
dm: &DM,
table: TargetLine<ThinTargetParams>,
) -> DmResult<()>
pub fn set_table( &mut self, dm: &DM, table: TargetLine<ThinTargetParams>, ) -> DmResult<()>
Set the table for the thin device’s target