libstorage-ng
|
A class to calculate partition alignment based on hardware topology. More...
#include <Alignment.h>
Public Member Functions | |
Alignment (const Topology &topology, AlignType align_type=AlignType::OPTIMAL) | |
Alignment (const Alignment &alignment) | |
Alignment (Alignment &&alignment)=default | |
Alignment & | operator= (const Alignment &alignment) |
Alignment & | operator= (Alignment &&alignment)=default |
bool | can_be_aligned (const Region ®ion, AlignPolicy align_policy) const |
Checks whether a region can be aligned. More... | |
Region | align (const Region ®ion, AlignPolicy align_policy=AlignPolicy::ALIGN_START_AND_END) const |
Aligns a region. More... | |
long | offset () const |
unsigned long | grain () const |
Impl & | get_impl () |
const Impl & | get_impl () const |
A class to calculate partition alignment based on hardware topology.
The starting sector of an aligned partition must obey the form "sector = offset + X * grain". Alignment may fail if the start of the aligned partition region is after the end of the aligned partition region.
Region storage::Alignment::align | ( | const Region & | region, |
AlignPolicy | align_policy = AlignPolicy::ALIGN_START_AND_END |
||
) | const |
Aligns a region.
AlignError |
bool storage::Alignment::can_be_aligned | ( | const Region & | region, |
AlignPolicy | align_policy | ||
) | const |
Checks whether a region can be aligned.
Alignment may fail if the aligned end is before the aligned start.