[−][src]Struct devicemapper::LinearDev
A DM construct of combined Segments
Methods
impl LinearDev
[src]
Use DM to concatenate a list of segments together into a linear block device of continuous sectors.
pub fn setup(
dm: &DM,
name: &DmName,
uuid: Option<&DmUuid>,
table: Vec<TargetLine<LinearDevTargetParams>>
) -> DmResult<LinearDev>
[src]
dm: &DM,
name: &DmName,
uuid: Option<&DmUuid>,
table: Vec<TargetLine<LinearDevTargetParams>>
) -> DmResult<LinearDev>
Construct a new block device by concatenating the given segments into linear space. If the device is already known to the kernel, just verifies that the segments argument passed exactly matches the kernel data.
Warning: If the segments overlap, this method will succeed. However, the behavior of the linear device in that case should be treated as undefined.
Note: A linear device is just a mapping in the kernel from locations in that device to locations on other devices which are specified by their device number. There is usually a device node so that data can be read from and written to the device. Other than that, it really has no existence. Consequently, there is no conflict in overloading this method to mean both "make a wholly new device" and "establish the existence of the requested device". Of course, a linear device is usually expected to hold data, so it is important to get the mapping just right.
pub fn set_table(
&mut self,
dm: &DM,
table: Vec<TargetLine<LinearDevTargetParams>>
) -> DmResult<()>
[src]
&mut self,
dm: &DM,
table: Vec<TargetLine<LinearDevTargetParams>>
) -> DmResult<()>
Set the segments for this linear 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 segments are compatible with the device's existing segments. If they are not, this function will still succeed, but some kind of data corruption will be the inevitable result.
pub fn set_name(&mut self, dm: &DM, name: &DmName) -> DmResult<()>
[src]
Set the name for this LinearDev.
Trait Implementations
impl DmDevice<LinearDevTargetTable> for LinearDev
[src]
fn device(&self) -> Device
[src]
fn devnode(&self) -> PathBuf
[src]
fn equivalent_tables(
left: &LinearDevTargetTable,
right: &LinearDevTargetTable
) -> DmResult<bool>
[src]
left: &LinearDevTargetTable,
right: &LinearDevTargetTable
) -> DmResult<bool>
fn name(&self) -> &DmName
[src]
fn size(&self) -> Sectors
[src]
fn table(&self) -> &LinearDevTargetTable
[src]
fn teardown(&mut self, dm: &DM) -> DmResult<()>
[src]
fn uuid(&self) -> Option<&DmUuid>
[src]
fn read_kernel_table(dm: &DM, id: &DevId) -> DmResult<T>
[src]
Read the devicemapper table
fn resume(&mut self, dm: &DM) -> DmResult<()>
[src]
Resume I/O on the device.
fn suspend(&mut self, dm: &DM, flush: bool) -> DmResult<()>
[src]
Suspend I/O on the device. If flush is true, flush the device first.
fn table_load(&self, dm: &DM, table: &T) -> DmResult<()>
[src]
Load a table
impl Debug for LinearDev
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,