pub struct ThinPoolDev { /* private fields */ }
Expand description

DM construct to contain thin provisioned devices

Implementations§

source§

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”

source

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.

source

pub fn meta_dev(&self) -> &LinearDev

Obtain the meta device that backs this thin pool device.

source

pub fn data_dev(&self) -> &LinearDev

Obtain the data device that backs this thin pool device.

source

pub fn data_block_size(&self) -> Sectors

Obtain the data block size for this thin pool device.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

Trait Implementations§

source§

impl Debug for ThinPoolDev

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl DmDevice<ThinPoolDevTargetTable> for ThinPoolDev

source§

fn device(&self) -> Device

The device.
source§

fn devnode(&self) -> PathBuf

The device’s device node.
source§

fn equivalent_tables( left: &ThinPoolDevTargetTable, right: &ThinPoolDevTargetTable ) -> 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) -> &ThinPoolDevTargetTable

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 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>,

§

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>,

§

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

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

§

fn vzip(self) -> V