Struct devicemapper::ThinPoolDev
source · pub struct ThinPoolDev { /* private fields */ }Expand description
DM construct to contain thin provisioned devices
Implementations§
source§impl ThinPoolDev
impl ThinPoolDev
Use DM to create a “thin-pool”. A “thin-pool” is shared space for other thin provisioned devices to use.
See section “Setting up a fresh pool device”
sourcepub fn new(
dm: &DM,
name: &DmName,
uuid: Option<&DmUuid>,
meta: LinearDev,
data: LinearDev,
data_block_size: Sectors,
low_water_mark: DataBlocks,
feature_args: Vec<String>
) -> DmResult<ThinPoolDev>
pub fn new(
dm: &DM,
name: &DmName,
uuid: Option<&DmUuid>,
meta: LinearDev,
data: LinearDev,
data_block_size: Sectors,
low_water_mark: DataBlocks,
feature_args: Vec<String>
) -> DmResult<ThinPoolDev>
Construct a new ThinPoolDev with the given data and meta devs.
Returns an error if the device is already known to the kernel.
Returns an error if data_block_size is not within required range.
Precondition: the metadata device does not contain any pool metadata.
sourcepub fn data_block_size(&self) -> Sectors
pub fn data_block_size(&self) -> Sectors
Obtain the data block size for this thin pool device.
sourcepub fn setup(
dm: &DM,
name: &DmName,
uuid: Option<&DmUuid>,
meta: LinearDev,
data: LinearDev,
data_block_size: Sectors,
low_water_mark: DataBlocks,
feature_args: Vec<String>
) -> DmResult<ThinPoolDev>
pub fn setup(
dm: &DM,
name: &DmName,
uuid: Option<&DmUuid>,
meta: LinearDev,
data: LinearDev,
data_block_size: Sectors,
low_water_mark: DataBlocks,
feature_args: Vec<String>
) -> DmResult<ThinPoolDev>
Set up a thin pool from the given metadata and data device. Returns an error if data_block_size is not within required range. Precondition: There is existing metadata for this thinpool device on the metadata device. If the metadata is corrupted, subsequent errors will result, so it is expected that the metadata is well-formed and consistent with the data on the data device.
sourcepub fn set_low_water_mark(
&mut self,
dm: &DM,
low_water_mark: DataBlocks
) -> DmResult<()>
pub fn set_low_water_mark(
&mut self,
dm: &DM,
low_water_mark: DataBlocks
) -> DmResult<()>
Set the low water mark. This action puts the device in a state where it is ready to be resumed.
sourcepub fn status(&self, dm: &DM, options: DmOptions) -> DmResult<ThinPoolStatus>
pub fn status(&self, dm: &DM, options: DmOptions) -> DmResult<ThinPoolStatus>
Get the current status of the thinpool. Returns an error if there was an error getting the status value.
sourcepub fn set_meta_table(
&mut self,
dm: &DM,
table: Vec<TargetLine<LinearDevTargetParams>>
) -> DmResult<()>
pub fn set_meta_table(
&mut self,
dm: &DM,
table: Vec<TargetLine<LinearDevTargetParams>>
) -> DmResult<()>
Set the table for the existing metadata 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 are not, this function will still succeed, but some kind of data corruption will be the inevitable result.
sourcepub fn set_data_table(
&mut self,
dm: &DM,
table: Vec<TargetLine<LinearDevTargetParams>>
) -> DmResult<()>
pub fn set_data_table(
&mut self,
dm: &DM,
table: Vec<TargetLine<LinearDevTargetParams>>
) -> DmResult<()>
Set the data device’s existing table. 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.
sourcepub fn error_if_no_space(&mut self, dm: &DM) -> DmResult<()>
pub fn error_if_no_space(&mut self, dm: &DM) -> DmResult<()>
Default behavior for devicemapper thin pools is to queue requests if
the thin pool is out of space to allow time for the thin pool to extend.
This behavior can be changed by adding the feature argument
error_if_no_space to the devicemapper table.
This method will add error_if_no_space from the devicemapper table
if it is not present.
sourcepub fn queue_if_no_space(&mut self, dm: &DM) -> DmResult<()>
pub fn queue_if_no_space(&mut self, dm: &DM) -> DmResult<()>
Default behavior for devicemapper thin pools is to queue requests if
the thin pool is out of space to allow time for the thin pool to extend.
This behavior can be changed by adding the feature argument
error_if_no_space to the devicemapper table.
This method will remove error_if_no_space from the devicemapper table
if it is present.
sourcepub fn skip_block_zeroing(&mut self, dm: &DM) -> DmResult<()>
pub fn skip_block_zeroing(&mut self, dm: &DM) -> DmResult<()>
Default behavior for devicemapper thin pools is to zero newly allocated
data blocks. This behavior can be changed by adding the feature argument
skip_block_zeroing to the devicemapper table.
This method will add skip_block_zeroing from the devicemapper table
if it is not present.
sourcepub fn require_block_zeroing(&mut self, dm: &DM) -> DmResult<()>
pub fn require_block_zeroing(&mut self, dm: &DM) -> DmResult<()>
Default behavior for devicemapper thin pools is to zero newly allocated
data blocks. This behavior can be changed by adding the feature argument
skip_block_zeroing to the devicemapper table.
This method will remove skip_block_zeroing from the devicemapper table
if it is present.
sourcepub fn no_discard_passdown(&mut self, dm: &DM) -> DmResult<()>
pub fn no_discard_passdown(&mut self, dm: &DM) -> DmResult<()>
Default behavior for devicemapper thin pools is to pass down discards.
This behavior can be changed by adding the feature argument
no_discard_passdown to the devicemapper table.
This method will add no_discard_passdown to the devicemapper table
if it is not present.
sourcepub fn discard_passdown(&mut self, dm: &DM) -> DmResult<()>
pub fn discard_passdown(&mut self, dm: &DM) -> DmResult<()>
Default behavior for devicemapper thin pools is to pass down discards.
This behavior can be changed by adding the feature argument
no_discard_passdown to the devicemapper table.
This method will remove no_discard_passdown from the devicemapper
table if it is present.