#include <MdPartCo.h>

Public Member Functions | |
| MdPartCo (Storage *const s, const string &Name, ProcPart *ppart=NULL) | |
| MdPartCo (const MdPartCo &rhs) | |
| virtual | ~MdPartCo () |
| unsigned long long | sizeK () const |
| const string & | labelName () const |
| const string & | udevPath () const |
| const std::list< string > & | udevId () const |
| unsigned | numPartitions () const |
| void | setUdevData (const list< string > &id) |
| bool | matchMdName (const string &name) |
| void | getMdPartCoState (storage::MdPartCoStateInfo &info) |
| int | createPartition (storage::PartitionType type, long unsigned start, long unsigned len, string &device, bool checkRelaxed=false) |
| int | createPartition (long unsigned len, string &device, bool checkRelaxed=false) |
| int | createPartition (storage::PartitionType type, string &device) |
| int | removePartition (unsigned nr) |
| int | changePartitionId (unsigned nr, unsigned id) |
| int | forgetChangePartitionId (unsigned nr) |
| int | changePartitionArea (unsigned nr, unsigned long start, unsigned long size, bool checkRelaxed=false) |
| int | nextFreePartition (storage::PartitionType type, unsigned &nr, string &device) const |
| int | destroyPartitionTable (const string &new_label) |
| int | freeCylindersAfterPartition (const MdPart *p, unsigned long &freeCyls) const |
| int | resizePartition (MdPart *p, unsigned long newCyl) |
| int | resizeVolume (Volume *v, unsigned long long newSize) |
| int | removeVolume (Volume *v) |
| int | removeMdPart () |
| unsigned | maxPrimary () const |
| bool | extendedPossible () const |
| unsigned | maxLogical () const |
| unsigned int | numPrimary () const |
| bool | hasExtended () const |
| unsigned int | numLogical () const |
| void | getUnusedSpace (std::list< Region > &free, bool all=true, bool logical=false) const |
| unsigned long long | cylinderToKb (unsigned long val) const |
| unsigned long | kbToCylinder (unsigned long long val) const |
| string | getPartName (unsigned nr) const |
| virtual void | getCommitActions (std::list< storage::commitAction * > &l) const |
| virtual int | getToCommit (storage::CommitStage stage, std::list< Container * > &col, std::list< Volume * > &vol) |
| virtual int | commitChanges (storage::CommitStage stage) |
| int | commitChanges (storage::CommitStage stage, Volume *vol) |
| Partition * | getPartition (unsigned nr, bool del) |
| int | getPartitionInfo (deque< storage::PartitionInfo > &plist) |
| void | getInfo (storage::MdPartCoInfo &info) const |
| bool | equalContent (const Container &rhs) const |
| virtual string | getDiffString (const Container &d) const |
| void | logDifference (const MdPartCo &d) const |
| MdPartCo & | operator= (const MdPartCo &rhs) |
| string | numToName (unsigned mdNum) const |
| void | syncRaidtab () |
| int | nr (const string &name) |
| int | nr () |
| unsigned long | chunkSize () const |
| storage::MdType | personality () const |
| storage::MdArrayState | getArrayState () |
| void | getMdUuid (string &val) |
| const string & | pName () const |
| const string & | ptName () const |
| void | getDevs (std::list< string > &devices, bool all=true, bool spare=false) const |
| void | getSpareDevs (std::list< string > &devices) |
Static Public Member Functions | |
| static storage::CType | staticType () |
| static string | undevName (const string &name) |
| static list< string > | getMdRaids () |
| static bool | matchMdRegex (const string &dev) |
| static unsigned | mdMajor () |
| static const string & | pName (storage::MdType t) |
| static void | activate (bool val, const string &tmpDir) |
| static bool | isActive (void) |
| static bool | hasPartitionTable (const string &name) |
| static bool | hasFileSystem (const string &name) |
| static bool | isImsmPlatform () |
| static bool | matchRegex (const string &dev) |
| static bool | mdStringNum (const string &name, unsigned &num) |
| static int | scanForRaid (list< string > &raidNames) |
| static list< string > | filterMdPartCo (list< string > &raidList, ProcPart &ppart, bool isInst) |
| static bool | getUuidName (const string dev, string &uuid, string &mdName) |
Protected Types | |
| enum | mdMap { MAP_DEV = 0, MAP_META, MAP_UUID, MAP_NAME } |
| enum | MdProperty { METADATA = 0, COMPONENT_SIZE, CHUNK_SIZE, ARRAY_STATE, LEVEL, LAYOUT, MDPROP_LAST } |
| typedef CastIterator< VIter, MdPart * > | MdPartInter |
| typedef CastIterator< CVIter, const MdPart * > | MdPartCInter |
| typedef CheckFnc< const MdPart > | CheckFncMdPart |
| typedef CheckerIterator < CheckFncMdPart, MdPartPI < CheckFncMdPart >::type, MdPartInter, MdPart > | MdPartPIterator |
| typedef CheckerIterator < CheckFncMdPart, MdPartCPI < CheckFncMdPart >::type, MdPartCInter, const MdPart > | MdPartCPIterator |
| typedef DerefIterator < MdPartPIterator, MdPart > | MdPartIter |
| typedef DerefIterator < MdPartCPIterator, const MdPart > | ConstMdPartIter |
| typedef IterPair< MdPartIter > | MdPartPair |
| typedef IterPair< ConstMdPartIter > | ConstMdPartPair |
Protected Member Functions | |
| MdPartPair | mdpartPair (bool(*CheckMdPart)(const MdPart &)=NULL) |
| MdPartIter | mdpartBegin (bool(*CheckMdPart)(const MdPart &)=NULL) |
| MdPartIter | mdpartEnd (bool(*CheckMdPart)(const MdPart &)=NULL) |
| ConstMdPartPair | mdpartPair (bool(*CheckMdPart)(const MdPart &)=NULL) const |
| ConstMdPartIter | mdpartBegin (bool(*CheckMdPart)(const MdPart &)=NULL) const |
| ConstMdPartIter | mdpartEnd (bool(*CheckMdPart)(const MdPart &)=NULL) const |
| MdPartCo (Storage *const s, const string &File) | |
| virtual void | print (std::ostream &s) const |
| virtual Container * | getCopy () const |
| void | activate_part (bool val) |
| void | init (ProcPart *ppart) |
| void | createDisk (ProcPart *ppart) |
| void | getVolumes (ProcPart *ppart) |
| void | updatePointers (bool invalid=false) |
| void | updateMinor () |
| virtual void | newP (MdPart *&dm, unsigned num, Partition *p) |
| int | addNewDev (string &device) |
| int | updateDelDev () |
| void | handleWholeDevice () |
| void | removeFromMemory () |
| void | removePresentPartitions () |
| bool | validPartition (const Partition *p) |
| bool | findMdPart (unsigned nr, MdPartIter &i) |
| void | updateEntry () |
| string | mdadmLine () const |
| void | raidtabLines (list< string > &lines) const |
| int | doCreate (Volume *v) |
| int | doRemove (Volume *v) |
| int | doResize (Volume *v) |
| int | doSetType (MdPart *v) |
| int | doCreateLabel () |
| virtual int | doRemove () |
| virtual string | removeText (bool doing) const |
| virtual string | setDiskLabelText (bool doing) const |
| void | getMajorMinor (void) |
| void | makeDevName (const string &name) |
| void | initMd (void) |
| void | setSize (unsigned long long size) |
| bool | isMdPart (const string &name) |
| void | getPartNum (const string &device, unsigned &num) |
| void | getMdProps (void) |
| void | setSpares (void) |
| int | unuseDevs (void) |
| void | logData (const string &Dir) |
| void | getParent () |
| void | setMetaData () |
| void | setMdDevs () |
| void | setMdParity () |
| void | getSlaves (const string name, std::list< string > &devs_list) |
| string | getContMember () const |
| bool | readProp (enum MdProperty prop, string &val) |
| bool | hasParity () const |
Static Protected Member Functions | |
| static bool | partNotDeleted (const MdPart &d) |
| static bool | isMdName (const string &name) |
| static bool | findMdMap (std::ifstream &file) |
| static storage::CType | envSelection (const string &name) |
| static bool | havePartsInProc (const string &name, ProcPart &ppart) |
| static void | getMdMajor () |
| static storage::MdType | toMdType (const string &val) |
| static storage::MdParity | toMdParity (const string &val) |
| static storage::MdArrayState | toMdArrayState (const string &val) |
Protected Attributes | |
| string | udev_path |
| std::list< string > | udev_id |
| string | logfile_name |
| Disk * | disk |
| bool | del_ptable |
| unsigned | num_part |
| unsigned long | chunk_size |
| storage::MdType | md_type |
| storage::MdParity | md_parity |
| storage::MdArrayState | md_state |
| bool | has_container |
| string | parent_container |
| string | parent_uuid |
| string | parent_metadata |
| string | parent_md_name |
| string | md_metadata |
| string | md_uuid |
| string | sb_ver |
| bool | destrSb |
| std::list< string > | devs |
| std::list< string > | spare |
| string | md_name |
| storage::MdPartCoInfo | info |
Static Protected Attributes | |
| static string | md_names [storage::MULTIPATH+1] |
| static string | par_names [storage::RIGHT_SYMMETRIC+1] |
| static string | md_states [storage::ACTIVE_IDLE+1] |
| static unsigned | md_major = 0 |
| static string | sysfs_path = "/sys/devices/virtual/block/" |
| static string | md_props [MDPROP_LAST] |
| static bool | active = false |
Friends | |
| class | Storage |
| std::ostream & | operator<< (std::ostream &, const MdPartCo &) |
Classes | |
| struct | MdPartCPI |
| struct | MdPartPI |
Brief: MD RAID Volume that can be partitioned and used as container for partitions.
typedef CastIterator<VIter, MdPart *> storage::MdPartCo::MdPartInter [protected] |
typedef CastIterator<CVIter, const MdPart *> storage::MdPartCo::MdPartCInter [protected] |
typedef CheckFnc<const MdPart> storage::MdPartCo::CheckFncMdPart [protected] |
typedef CheckerIterator< CheckFncMdPart, MdPartPI<CheckFncMdPart>::type, MdPartInter, MdPart > storage::MdPartCo::MdPartPIterator [protected] |
typedef CheckerIterator< CheckFncMdPart, MdPartCPI<CheckFncMdPart>::type, MdPartCInter, const MdPart > storage::MdPartCo::MdPartCPIterator [protected] |
typedef DerefIterator<MdPartPIterator,MdPart> storage::MdPartCo::MdPartIter [protected] |
typedef DerefIterator<MdPartCPIterator,const MdPart> storage::MdPartCo::ConstMdPartIter [protected] |
typedef IterPair<MdPartIter> storage::MdPartCo::MdPartPair [protected] |
typedef IterPair<ConstMdPartIter> storage::MdPartCo::ConstMdPartPair [protected] |
enum storage::MdPartCo::mdMap [protected] |
enum storage::MdPartCo::MdProperty [protected] |
References del_ptable, storage::Container::dev, devs, disk, getMajorMinor(), init(), initMd(), makeDevName(), md_type, storage::Container::nm, undevName(), and y2mil.
Referenced by getCopy().
| storage::MdPartCo::MdPartCo | ( | const MdPartCo & | rhs | ) |
References active, storage::IterPair< Iter >::begin(), chunk_size, del_ptable, destrSb, devs, disk, storage::IterPair< Iter >::end(), storage::Container::getStorage(), has_container, md_metadata, md_name, md_parity, md_state, md_type, md_uuid, mdpartPair(), storage::Container::nm, num_part, parent_container, parent_md_name, parent_metadata, parent_uuid, sb_ver, spare, udev_id, udev_path, updatePointers(), storage::Container::vols, storage::Storage::waitForDevice(), and y2deb.
| storage::MdPartCo::~MdPartCo | ( | ) | [virtual] |
References storage::Container::dev, disk, and y2deb.
| storage::MdPartCo::MdPartCo | ( | Storage *const | s, | |
| const string & | File | |||
| ) | [protected] |
| unsigned long long storage::MdPartCo::sizeK | ( | ) | const [inline] |
| const string& storage::MdPartCo::labelName | ( | ) | const [inline] |
References disk, and storage::Disk::labelName().
Referenced by doCreateLabel(), and setDiskLabelText().
| const string& storage::MdPartCo::udevPath | ( | ) | const [inline] |
References udev_path.
| const std::list<string>& storage::MdPartCo::udevId | ( | ) | const [inline] |
| unsigned storage::MdPartCo::numPartitions | ( | ) | const [inline] |
References disk, and storage::Disk::numPartitions().
| static storage::CType storage::MdPartCo::staticType | ( | ) | [inline, static] |
Reimplemented from storage::Container.
References storage::MDPART.
Referenced by getCommitActions().
| void storage::MdPartCo::setUdevData | ( | const list< string > & | id | ) |
References storage::IterPair< Iter >::begin(), disk, storage::IterPair< Iter >::end(), mdpartPair(), storage::Container::nm, storage::Disk::setUdevData(), udev_id, and y2mil.
Referenced by storage::Storage::detectMdParts().
| bool storage::MdPartCo::matchMdName | ( | const string & | name | ) | [inline] |
| void storage::MdPartCo::getMdPartCoState | ( | storage::MdPartCoStateInfo & | info | ) |
| int storage::MdPartCo::createPartition | ( | storage::PartitionType | type, | |
| long unsigned | start, | |||
| long unsigned | len, | |||
| string & | device, | |||
| bool | checkRelaxed = false | |||
| ) |
| int storage::MdPartCo::createPartition | ( | long unsigned | len, | |
| string & | device, | |||
| bool | checkRelaxed = false | |||
| ) |
| int storage::MdPartCo::createPartition | ( | storage::PartitionType | type, | |
| string & | device | |||
| ) |
| int storage::MdPartCo::removePartition | ( | unsigned | nr | ) |
| int storage::MdPartCo::changePartitionId | ( | unsigned | nr, | |
| unsigned | id | |||
| ) |
References storage::Disk::changePartitionId(), disk, storage::MDPART_PARTITION_NOT_FOUND, and y2mil.
Referenced by storage::Storage::changePartitionId().
| int storage::MdPartCo::forgetChangePartitionId | ( | unsigned | nr | ) |
References disk, storage::Disk::forgetChangePartitionId(), storage::MDPART_PARTITION_NOT_FOUND, and y2mil.
Referenced by storage::Storage::forgetChangePartitionId().
| int storage::MdPartCo::changePartitionArea | ( | unsigned | nr, | |
| unsigned long | start, | |||
| unsigned long | size, | |||
| bool | checkRelaxed = false | |||
| ) |
References storage::Disk::changePartitionArea(), disk, findMdPart(), storage::MDPART_PARTITION_NOT_FOUND, and y2mil.
Referenced by storage::Storage::updatePartitionArea().
| int storage::MdPartCo::nextFreePartition | ( | storage::PartitionType | type, | |
| unsigned & | nr, | |||
| string & | device | |||
| ) | const |
References disk, storage::Disk::nextFreePartition(), numToName(), and y2mil.
| int storage::MdPartCo::destroyPartitionTable | ( | const string & | new_label | ) |
References del_ptable, storage::Disk::destroyPartitionTable(), storage::Container::device(), disk, storage::Storage::getRecursiveRemoval(), storage::Container::getStorage(), storage::Container::getUsedBy(), storage::Container::getUsedByType(), storage::Storage::removeUsing(), storage::Storage::removeVolume(), storage::Container::ronly, storage::Storage::setRecursiveRemoval(), storage::UB_NONE, storage::Container::vols, and y2mil.
| int storage::MdPartCo::freeCylindersAfterPartition | ( | const MdPart * | p, | |
| unsigned long & | freeCyls | |||
| ) | const |
References disk, storage::Disk::freeCylindersAfterPartition(), storage::MdPart::getPtr(), storage::MDPART_PARTITION_NOT_FOUND, and y2mil.
Referenced by storage::Storage::freeCylindersAfterPartition().
| int storage::MdPartCo::resizePartition | ( | MdPart * | p, | |
| unsigned long | newCyl | |||
| ) |
| int storage::MdPartCo::resizeVolume | ( | Volume * | v, | |
| unsigned long long | newSize | |||
| ) | [virtual] |
Reimplemented from storage::Container.
References disk, storage::Volume::getFsInfo(), storage::MdPart::getPtr(), storage::MDPART_CHANGE_READONLY, storage::MDPART_INTERNAL_ERR, storage::MDPART_INVALID_VOLUME, storage::MDPART_PARTITION_NOT_FOUND, storage::Volume::nr(), storage::Container::readonly(), storage::Disk::resizeVolume(), storage::MdPart::updateSize(), and y2mil.
| int storage::MdPartCo::removeVolume | ( | Volume * | v | ) | [virtual] |
| int storage::MdPartCo::removeMdPart | ( | ) |
References storage::IterPair< Iter >::begin(), storage::Container::created(), del_ptable, destrSb, storage::IterPair< Iter >::end(), storage::MDPART_CHANGE_READONLY, storage::MDPART_PARTITION_NOT_FOUND, mdpartPair(), storage::MdPart::notDeleted(), storage::Container::readonly(), storage::Container::removeFromList(), removePartition(), storage::Container::setDeleted(), unuseDevs(), y2err, y2mil, and y2war.
| unsigned storage::MdPartCo::maxPrimary | ( | ) | const [inline] |
References disk, and storage::Disk::maxPrimary().
| bool storage::MdPartCo::extendedPossible | ( | ) | const [inline] |
References disk, and storage::Disk::extendedPossible().
| unsigned storage::MdPartCo::maxLogical | ( | ) | const [inline] |
References disk, and storage::Disk::maxLogical().
| unsigned int storage::MdPartCo::numPrimary | ( | ) | const [inline] |
References disk, and storage::Disk::numPrimary().
| bool storage::MdPartCo::hasExtended | ( | ) | const [inline] |
References disk, and storage::Disk::hasExtended().
| unsigned int storage::MdPartCo::numLogical | ( | ) | const [inline] |
References disk, and storage::Disk::numLogical().
| void storage::MdPartCo::getUnusedSpace | ( | std::list< Region > & | free, | |
| bool | all = true, |
|||
| bool | logical = false | |||
| ) | const [inline] |
References disk, and storage::Disk::getUnusedSpace().
| unsigned long long storage::MdPartCo::cylinderToKb | ( | unsigned long | val | ) | const [inline] |
References storage::Disk::cylinderToKb(), and disk.
| unsigned long storage::MdPartCo::kbToCylinder | ( | unsigned long long | val | ) | const [inline] |
References disk, and storage::Disk::kbToCylinder().
| string storage::MdPartCo::getPartName | ( | unsigned | nr | ) | const |
| void storage::MdPartCo::getCommitActions | ( | std::list< storage::commitAction * > & | l | ) | const [virtual] |
Reimplemented from storage::Container.
References storage::DECREASE, del_ptable, storage::Container::deleted(), storage::Container::getCommitActions(), removeText(), setDiskLabelText(), staticType(), and y2mil.
| int storage::MdPartCo::getToCommit | ( | storage::CommitStage | stage, | |
| std::list< Container * > & | col, | |||
| std::list< Volume * > & | vol | |||
| ) | [virtual] |
| int storage::MdPartCo::commitChanges | ( | storage::CommitStage | stage | ) | [virtual] |
Reimplemented from storage::Container.
References storage::DECREASE, del_ptable, storage::Container::deleted(), doCreateLabel(), doRemove(), storage::MDPART_COMMIT_NOTHING_TODO, storage::Container::name(), and y2mil.
| int storage::MdPartCo::commitChanges | ( | storage::CommitStage | stage, | |
| Volume * | vol | |||
| ) | [virtual] |
Reimplemented from storage::Container.
References storage::Container::commitChanges(), disk, doSetType(), storage::MdPart::getPtr(), storage::INCREASE, storage::MDPART_INVALID_VOLUME, storage::Container::name(), storage::Partition::toChangeId(), and y2mil.
| Partition * storage::MdPartCo::getPartition | ( | unsigned | nr, | |
| bool | del | |||
| ) |
References storage::IterPair< Iter >::begin(), disk, storage::IterPair< Iter >::end(), storage::Disk::partPair(), and y2mil.
Referenced by addNewDev(), and updatePointers().
| int storage::MdPartCo::getPartitionInfo | ( | deque< storage::PartitionInfo > & | plist | ) |
| void storage::MdPartCo::getInfo | ( | storage::MdPartCoInfo & | info | ) | const |
References storage::MdPartCoInfo::chunk, chunk_size, storage::MdPartCoInfo::d, storage::MdPartCoInfo::devices, devs, disk, storage::Disk::getInfo(), info, storage::MdPartCoInfo::level, md_name, storage::MdPartCoInfo::md_name, md_parity, md_type, md_uuid, storage::MdPartCoInfo::minor, storage::Container::mnr, storage::MdPartCoInfo::nr, storage::MdPartCoInfo::parity, sb_ver, storage::MdPartCoInfo::sb_ver, storage::MdPartCoInfo::spares, and storage::MdPartCoInfo::uuid.
| bool storage::MdPartCo::equalContent | ( | const Container & | rhs | ) | const [virtual] |
Reimplemented from storage::Container.
References active, storage::IterPair< Iter >::begin(), chunk_size, del_ptable, destrSb, devs, storage::IterPair< Iter >::end(), storage::Container::equalContent(), has_container, md_name, md_parity, md_state, md_type, md_uuid, mdpartPair(), parent_container, parent_md_name, parent_metadata, parent_uuid, sb_ver, and spare.
| string storage::MdPartCo::getDiffString | ( | const Container & | d | ) | const [virtual] |
Reimplemented from storage::Container.
References active, del_ptable, and storage::Container::getDiffString().
Referenced by logDifference().
| void storage::MdPartCo::logDifference | ( | const MdPartCo & | d | ) | const |
References storage::IterPair< Iter >::begin(), chunk_size, storage::classic(), storage::decString(), destrSb, devs, storage::IterPair< Iter >::end(), getDiffString(), md_name, md_names, md_parity, md_type, md_uuid, mdpartPair(), par_names, parent_container, parent_md_name, parent_metadata, parent_uuid, sb_ver, spare, and y2mil.
| string storage::MdPartCo::undevName | ( | const string & | name | ) | [static] |
Referenced by storage::Storage::findMdPartCo(), isMdPart(), and MdPartCo().
| string storage::MdPartCo::numToName | ( | unsigned | mdNum | ) | const |
References storage::decString(), and storage::Container::nm.
Referenced by addNewDev(), storage::MdPart::MdPart(), nextFreePartition(), and storage::MdPart::updateName().
| list< string > storage::MdPartCo::getMdRaids | ( | ) | [static] |
References storage::classic(), storage::extractNthWord(), getline(), isMdName(), and y2mil.
Referenced by storage::Storage::detectMdParts(), and storage::Storage::discoverMdPVols().
| void storage::MdPartCo::syncRaidtab | ( | ) |
References updateEntry().
| int storage::MdPartCo::nr | ( | const string & | name | ) |
Referenced by storage::Storage::getMdPartMdNums().
| int storage::MdPartCo::nr | ( | ) |
| unsigned long storage::MdPartCo::chunkSize | ( | ) | const [inline] |
References chunk_size.
| storage::MdType storage::MdPartCo::personality | ( | ) | const [inline] |
References md_type.
| storage::MdArrayState storage::MdPartCo::getArrayState | ( | ) | [inline] |
References md_state.
| void storage::MdPartCo::getMdUuid | ( | string & | val | ) | [inline] |
References md_uuid.
| const string& storage::MdPartCo::pName | ( | ) | const [inline] |
| const string& storage::MdPartCo::ptName | ( | ) | const [inline] |
| void storage::MdPartCo::getDevs | ( | std::list< string > & | devices, | |
| bool | all = true, |
|||
| bool | spare = false | |||
| ) | const |
| void storage::MdPartCo::getSpareDevs | ( | std::list< string > & | devices | ) |
References spare.
| bool storage::MdPartCo::matchMdRegex | ( | const string & | dev | ) | [static] |
References storage::Regex::match().
| unsigned storage::MdPartCo::mdMajor | ( | ) | [static] |
References getMdMajor(), and md_major.
| static const string& storage::MdPartCo::pName | ( | storage::MdType | t | ) | [inline, static] |
References md_names.
| void storage::MdPartCo::activate | ( | bool | val, | |
| const string & | tmpDir | |||
| ) | [static] |
| static bool storage::MdPartCo::isActive | ( | void | ) | [inline, static] |
References active.
| bool storage::MdPartCo::hasPartitionTable | ( | const string & | name | ) | [static] |
| bool storage::MdPartCo::hasFileSystem | ( | const string & | name | ) | [static] |
References BLKIDBIN, storage::SystemCmd::execute(), storage::quote(), and storage::SystemCmd::retcode().
Referenced by filterMdPartCo().
| bool storage::MdPartCo::isImsmPlatform | ( | ) | [static] |
References storage::SystemCmd::execute(), storage::SystemCmd::getLine(), MDADMBIN, storage::SystemCmd::numLines(), and storage::SystemCmd::select().
Referenced by storage::Storage::discoverMdPVols().
| bool storage::MdPartCo::matchRegex | ( | const string & | dev | ) | [static] |
| bool storage::MdPartCo::mdStringNum | ( | const string & | name, | |
| unsigned & | num | |||
| ) | [static] |
References matchRegex(), and storage::undevDevice().
| int storage::MdPartCo::scanForRaid | ( | list< string > & | raidNames | ) | [static] |
References storage::extractNthWord(), storage::SystemCmd::getLine(), MDADMBIN, storage::SystemCmd::numLines(), storage::SystemCmd::retcode(), and y2mil.
Referenced by storage::Storage::discoverMdPVols().
| list< string > storage::MdPartCo::filterMdPartCo | ( | list< string > & | raidList, | |
| ProcPart & | ppart, | |||
| bool | isInst | |||
| ) | [static] |
References envSelection(), hasFileSystem(), hasPartitionTable(), havePartsInProc(), storage::MD, storage::MDPART, and y2mil.
Referenced by storage::Storage::detectMdParts().
| bool storage::MdPartCo::getUuidName | ( | const string | dev, | |
| string & | uuid, | |||
| string & | mdName | |||
| ) | [static] |
References storage::classic(), storage::extractNthWord(), findMdMap(), storage::SystemCmd::getLine(), getline(), MAP_DEV, MAP_NAME, MAP_UUID, MDADMBIN, storage::quote(), storage::SystemCmd::retcode(), and storage::SystemCmd::select().
Referenced by getMdProps(), and storage::Md::Md().
| MdPartPair storage::MdPartCo::mdpartPair | ( | bool(*)(const MdPart &) | CheckMdPart = NULL |
) | [inline, protected] |
References mdpartBegin(), and mdpartEnd().
Referenced by equalContent(), findMdPart(), getToCommit(), logDifference(), MdPartCo(), removeMdPart(), setUdevData(), updateDelDev(), updateMinor(), and updatePointers().
| MdPartIter storage::MdPartCo::mdpartBegin | ( | bool(*)(const MdPart &) | CheckMdPart = NULL |
) | [inline, protected] |
| MdPartIter storage::MdPartCo::mdpartEnd | ( | bool(*)(const MdPart &) | CheckMdPart = NULL |
) | [inline, protected] |
| ConstMdPartPair storage::MdPartCo::mdpartPair | ( | bool(*)(const MdPart &) | CheckMdPart = NULL |
) | const [inline, protected] |
References mdpartBegin(), and mdpartEnd().
| ConstMdPartIter storage::MdPartCo::mdpartBegin | ( | bool(*)(const MdPart &) | CheckMdPart = NULL |
) | const [inline, protected] |
References storage::Container::begin(), and storage::Container::end().
| ConstMdPartIter storage::MdPartCo::mdpartEnd | ( | bool(*)(const MdPart &) | CheckMdPart = NULL |
) | const [inline, protected] |
References storage::Container::begin(), and storage::Container::end().
| virtual void storage::MdPartCo::print | ( | std::ostream & | s | ) | const [inline, protected, virtual] |
Reimplemented from storage::Container.
| virtual Container* storage::MdPartCo::getCopy | ( | ) | const [inline, protected, virtual] |
| void storage::MdPartCo::activate_part | ( | bool | val | ) | [protected] |
Referenced by doCreate(), and doResize().
| void storage::MdPartCo::init | ( | ProcPart * | ppart | ) | [protected] |
References createDisk(), storage::ProcPart::getSize(), getVolumes(), storage::Container::nm, storage::Container::size_k, and y2mil.
Referenced by MdPartCo().
| void storage::MdPartCo::createDisk | ( | ProcPart * | ppart | ) | [protected] |
| void storage::MdPartCo::getVolumes | ( | ProcPart * | ppart | ) | [protected] |
| void storage::MdPartCo::updatePointers | ( | bool | invalid = false |
) | [protected] |
References storage::IterPair< Iter >::begin(), storage::IterPair< Iter >::end(), getPartition(), and mdpartPair().
Referenced by MdPartCo().
| void storage::MdPartCo::updateMinor | ( | ) | [protected] |
References storage::IterPair< Iter >::begin(), storage::IterPair< Iter >::end(), and mdpartPair().
Referenced by doCreate(), and doResize().
Referenced by addNewDev(), getVolumes(), and handleWholeDevice().
| int storage::MdPartCo::addNewDev | ( | string & | device | ) | [protected] |
References storage::Container::addToList(), storage::Container::dev, storage::Volume::getFsInfo(), getPartition(), getPartNum(), handleWholeDevice(), isMdPart(), storage::MD_PARTITION_NOT_FOUND, storage::MDPART_PARTITION_NOT_FOUND, newP(), storage::Volume::nr(), numToName(), storage::Volume::setCreated(), y2mil, and y2war.
Referenced by createPartition().
| int storage::MdPartCo::updateDelDev | ( | ) | [protected] |
References storage::IterPair< Iter >::begin(), storage::Volume::deleted(), storage::IterPair< Iter >::end(), handleWholeDevice(), storage::MDPART_PARTITION_NOT_FOUND, mdpartPair(), storage::Volume::nr(), storage::Container::removeFromList(), validPartition(), and y2mil.
Referenced by removePartition(), and removeVolume().
| void storage::MdPartCo::handleWholeDevice | ( | ) | [protected] |
References storage::Container::addToList(), disk, storage::IterPair< Iter >::empty(), findMdPart(), newP(), storage::Partition::notDeleted(), storage::Disk::partPair(), storage::Container::removeFromList(), storage::Volume::setSize(), storage::Container::size_k, y2err, and y2mil.
Referenced by addNewDev(), doCreateLabel(), getVolumes(), and updateDelDev().
| void storage::MdPartCo::removeFromMemory | ( | ) | [protected] |
| void storage::MdPartCo::removePresentPartitions | ( | ) | [protected] |
| bool storage::MdPartCo::validPartition | ( | const Partition * | p | ) | [protected] |
References storage::IterPair< Iter >::begin(), disk, storage::IterPair< Iter >::end(), storage::Volume::nr(), storage::Disk::partPair(), and y2mil.
Referenced by updateDelDev().
| bool storage::MdPartCo::findMdPart | ( | unsigned | nr, | |
| MdPartIter & | i | |||
| ) | [protected] |
References storage::IterPair< Iter >::begin(), storage::IterPair< Iter >::end(), mdpartPair(), and storage::MdPart::notDeleted().
Referenced by changePartitionArea(), doRemove(), and handleWholeDevice().
| void storage::MdPartCo::updateEntry | ( | ) | [protected] |
References storage::EtcRaidtab::mdconf_info::container_info, storage::EtcRaidtab::mdconf_info::container_present, storage::Container::dev, storage::EtcRaidtab::mdconf_info::fs_name, getContMember(), storage::Storage::getRaidtab(), storage::Container::getStorage(), has_container, info, md_name, md_uuid, storage::EtcRaidtab::mdconf_info::md_uuid, storage::EtcRaidtab::mdconf_info::member, storage::EtcRaidtab::mdconf_info::metadata, parent_metadata, parent_uuid, and storage::EtcRaidtab::updateEntry().
Referenced by syncRaidtab().
| string storage::MdPartCo::mdadmLine | ( | ) | const [protected] |
References storage::Container::device(), md_uuid, pName(), and y2mil.
| void storage::MdPartCo::raidtabLines | ( | list< string > & | lines | ) | const [protected] |
| static bool storage::MdPartCo::partNotDeleted | ( | const MdPart & | d | ) | [inline, static, protected] |
References storage::Volume::deleted().
| int storage::MdPartCo::doCreate | ( | Volume * | v | ) | [protected, virtual] |
Reimplemented from storage::Container.
References activate_part(), active, disk, storage::Disk::doCreate(), doSetType(), storage::EXTENDED, storage::Container::getStorage(), storage::Partition::id(), storage::Partition::ID_LINUX, storage::MDPART_INTERNAL_ERR, storage::MDPART_INVALID_VOLUME, storage::MDPART_PARTITION_NOT_FOUND, storage::Volume::name(), storage::Container::name(), storage::Storage::showInfoCb(), storage::Container::silent, storage::Partition::type(), updateMinor(), storage::Storage::waitForDevice(), and y2mil.
| int storage::MdPartCo::doRemove | ( | Volume * | v | ) | [protected, virtual] |
Reimplemented from storage::Container.
References disk, storage::Disk::doRemove(), storage::Container::getStorage(), storage::MDPART_INTERNAL_ERR, storage::MDPART_INVALID_VOLUME, storage::MDPART_PARTITION_NOT_FOUND, storage::MDPART_REMOVE_PARTITION_LIST_ERASE, storage::Volume::name(), storage::Container::name(), storage::Volume::prepareRemove(), storage::Container::removeFromList(), storage::Storage::showInfoCb(), storage::Container::silent, storage::Storage::waitForDevice(), y2error, y2mil, and y2warning.
| int storage::MdPartCo::doResize | ( | Volume * | v | ) | [protected, virtual] |
Reimplemented from storage::Container.
References activate_part(), active, disk, storage::Disk::doResize(), storage::FSNONE, storage::Container::getStorage(), storage::MDPART_INTERNAL_ERR, storage::MDPART_INVALID_VOLUME, storage::MDPART_PARTITION_NOT_FOUND, storage::Volume::name(), storage::Container::name(), storage::Storage::showInfoCb(), storage::Container::silent, updateMinor(), storage::VFAT, storage::Storage::waitForDevice(), and y2mil.
| int storage::MdPartCo::doSetType | ( | MdPart * | v | ) | [protected] |
References disk, storage::Disk::doSetType(), storage::MdPart::getPtr(), storage::Container::getStorage(), storage::MDPART_PARTITION_NOT_FOUND, storage::Volume::name(), storage::Container::name(), storage::MdPart::setTypeText(), storage::Storage::showInfoCb(), storage::Container::silent, and y2mil.
Referenced by commitChanges(), and doCreate().
| int storage::MdPartCo::doCreateLabel | ( | ) | [protected] |
References del_ptable, storage::Container::device(), disk, storage::Disk::doCreateLabel(), storage::Container::getStorage(), handleWholeDevice(), labelName(), storage::Storage::removeDmMapsTo(), removeFromMemory(), removePresentPartitions(), setDiskLabelText(), storage::Storage::showInfoCb(), storage::Container::silent, storage::Storage::waitForDevice(), and y2mil.
Referenced by commitChanges().
| int storage::MdPartCo::doRemove | ( | ) | [protected, virtual] |
References storage::Container::deleted(), destrSb, storage::Container::device(), disk, storage::SystemCmd::execute(), findMdPart(), getDevs(), storage::Storage::getRaidtab(), storage::Container::getStorage(), storage::MD_REMOVE_FAILED, MDADMBIN, storage::MDPART_NO_REMOVE, storage::Container::name(), nr(), storage::Disk::numPartitions(), storage::quote(), storage::EtcRaidtab::removeEntry(), removeText(), storage::SystemCmd::retcode(), sb_ver, storage::Container::setExtError(), storage::Storage::showInfoCb(), storage::Container::silent, y2error, y2mil, and y2milestone.
Referenced by commitChanges(), and removePresentPartitions().
| string storage::MdPartCo::removeText | ( | bool | doing | ) | const [protected, virtual] |
Reimplemented from storage::Container.
References storage::_(), storage::Container::name(), and storage::sformat().
Referenced by doRemove(), and getCommitActions().
| string storage::MdPartCo::setDiskLabelText | ( | bool | doing | ) | const [protected, virtual] |
References storage::_(), storage::Container::dev, labelName(), and storage::sformat().
Referenced by doCreateLabel(), and getCommitActions().
| void storage::MdPartCo::getMajorMinor | ( | void | ) | [protected] |
References storage::classic(), storage::Container::mjr, storage::Container::mnr, storage::Container::nm, and sysfs_path.
Referenced by MdPartCo().
| void storage::MdPartCo::makeDevName | ( | const string & | name | ) | [protected] |
| void storage::MdPartCo::initMd | ( | void | ) | [protected] |
| void storage::MdPartCo::setSize | ( | unsigned long long | size | ) | [protected] |
| bool storage::MdPartCo::isMdName | ( | const string & | name | ) | [static, protected] |
References storage::Regex::match().
Referenced by storage::Storage::autodetectDisks(), and getMdRaids().
| bool storage::MdPartCo::isMdPart | ( | const string & | name | ) | [protected] |
| void storage::MdPartCo::getPartNum | ( | const string & | device, | |
| unsigned & | num | |||
| ) | [protected] |
| void storage::MdPartCo::getMdProps | ( | void | ) | [protected] |
References ARRAY_STATE, chunk_size, CHUNK_SIZE, COMPONENT_SIZE, storage::Container::dev, getUuidName(), has_container, LEVEL, md_metadata, md_name, md_state, md_type, md_uuid, METADATA, storage::Container::nm, parent_container, parent_md_name, parent_uuid, storage::RAID_UNK, readProp(), setMdDevs(), setMdParity(), setMetaData(), setSize(), setSpares(), toMdArrayState(), toMdType(), storage::UNKNOWN, y2mil, and y2war.
Referenced by initMd().
| void storage::MdPartCo::setSpares | ( | void | ) | [protected] |
References devs, getParent(), getSlaves(), storage::Container::getStorage(), has_container, storage::Container::nm, parent_container, storage::Storage::setUsedBy(), spare, and storage::UB_MDPART.
Referenced by getMdProps().
| int storage::MdPartCo::unuseDevs | ( | void | ) | [protected] |
References storage::Storage::clearUsedBy(), getDevs(), and storage::Container::getStorage().
Referenced by removeMdPart().
| void storage::MdPartCo::logData | ( | const string & | Dir | ) | [protected, virtual] |
Reimplemented from storage::Container.
| void storage::MdPartCo::getParent | ( | ) | [protected] |
References has_container, md_metadata, METADATA, parent_container, and readProp().
Referenced by setMetaData(), and setSpares().
| void storage::MdPartCo::setMetaData | ( | ) | [protected] |
References storage::classic(), getParent(), has_container, md_metadata, md_props, METADATA, parent_container, parent_metadata, sb_ver, and sysfs_path.
Referenced by getMdProps().
| void storage::MdPartCo::setMdDevs | ( | ) | [protected] |
References devs, getSlaves(), storage::Container::getStorage(), storage::Container::nm, storage::Storage::setUsedBy(), and storage::UB_MDPART.
Referenced by getMdProps().
| void storage::MdPartCo::setMdParity | ( | ) | [protected] |
References hasParity(), storage::LEFT_ASYMMETRIC, md_parity, md_type, storage::PAR_NONE, storage::RAID10, storage::RAID5, and storage::RAID6.
Referenced by getMdProps().
| void storage::MdPartCo::getSlaves | ( | const string | name, | |
| std::list< string > & | devs_list | |||
| ) | [protected] |
| bool storage::MdPartCo::findMdMap | ( | std::ifstream & | file | ) | [static, protected] |
| string storage::MdPartCo::getContMember | ( | ) | const [protected] |
| storage::CType storage::MdPartCo::envSelection | ( | const string & | name | ) | [static, protected] |
References storage::CUNKNOWN, storage::MD, storage::MDPART, and str.
Referenced by filterMdPartCo().
| bool storage::MdPartCo::havePartsInProc | ( | const string & | name, | |
| ProcPart & | ppart | |||
| ) | [static, protected] |
| void storage::MdPartCo::getMdMajor | ( | ) | [static, protected] |
| MdType storage::MdPartCo::toMdType | ( | const string & | val | ) | [static, protected] |
| MdParity storage::MdPartCo::toMdParity | ( | const string & | val | ) | [static, protected] |
References par_names, storage::PAR_NONE, and storage::RIGHT_SYMMETRIC.
| storage::MdArrayState storage::MdPartCo::toMdArrayState | ( | const string & | val | ) | [static, protected] |
References storage::ACTIVE_IDLE, md_states, and storage::UNKNOWN.
Referenced by getMdPartCoState(), and getMdProps().
| bool storage::MdPartCo::readProp | ( | enum MdProperty | prop, | |
| string & | val | |||
| ) | [protected] |
References storage::classic(), md_props, storage::Container::nm, sysfs_path, and y2war.
Referenced by getMdPartCoState(), getMdProps(), and getParent().
| bool storage::MdPartCo::hasParity | ( | ) | const [inline, protected] |
References md_type, storage::RAID10, storage::RAID5, and storage::RAID6.
Referenced by setMdParity().
friend class Storage [friend] |
Reimplemented from storage::Container.
| std::ostream& operator<< | ( | std::ostream & | s, | |
| const MdPartCo & | d | |||
| ) | [friend] |
string storage::MdPartCo::udev_path [protected] |
Referenced by MdPartCo(), and udevPath().
std::list<string> storage::MdPartCo::udev_id [protected] |
Referenced by MdPartCo(), storage::operator<<(), setUdevData(), and udevId().
string storage::MdPartCo::logfile_name [protected] |
Disk* storage::MdPartCo::disk [protected] |
Referenced by changePartitionArea(), changePartitionId(), commitChanges(), createDisk(), createPartition(), cylinderToKb(), destroyPartitionTable(), doCreate(), doCreateLabel(), doRemove(), doResize(), doSetType(), extendedPossible(), forgetChangePartitionId(), freeCylindersAfterPartition(), getInfo(), getPartition(), getPartitionInfo(), getUnusedSpace(), getVolumes(), handleWholeDevice(), hasExtended(), kbToCylinder(), labelName(), maxLogical(), maxPrimary(), MdPartCo(), nextFreePartition(), numLogical(), numPartitions(), numPrimary(), removePartition(), removeVolume(), resizePartition(), resizeVolume(), setUdevData(), validPartition(), and ~MdPartCo().
bool storage::MdPartCo::del_ptable [protected] |
unsigned storage::MdPartCo::num_part [protected] |
Referenced by getVolumes(), MdPartCo(), and storage::operator<<().
unsigned long storage::MdPartCo::chunk_size [protected] |
Referenced by chunkSize(), equalContent(), getInfo(), getMdProps(), logDifference(), MdPartCo(), and raidtabLines().
storage::MdType storage::MdPartCo::md_type [protected] |
Referenced by equalContent(), getInfo(), getMdProps(), hasParity(), logDifference(), MdPartCo(), personality(), pName(), raidtabLines(), and setMdParity().
storage::MdParity storage::MdPartCo::md_parity [protected] |
Referenced by equalContent(), getInfo(), logDifference(), MdPartCo(), ptName(), raidtabLines(), and setMdParity().
storage::MdArrayState storage::MdPartCo::md_state [protected] |
Referenced by equalContent(), getArrayState(), getMdProps(), and MdPartCo().
bool storage::MdPartCo::has_container [protected] |
Referenced by equalContent(), getMdProps(), getParent(), MdPartCo(), setMetaData(), setSpares(), and updateEntry().
string storage::MdPartCo::parent_container [protected] |
Referenced by equalContent(), getMdProps(), getParent(), logDifference(), MdPartCo(), setMetaData(), and setSpares().
string storage::MdPartCo::parent_uuid [protected] |
Referenced by equalContent(), getMdProps(), logDifference(), MdPartCo(), and updateEntry().
string storage::MdPartCo::parent_metadata [protected] |
Referenced by equalContent(), logDifference(), MdPartCo(), setMetaData(), and updateEntry().
string storage::MdPartCo::parent_md_name [protected] |
Referenced by equalContent(), getMdProps(), logDifference(), and MdPartCo().
string storage::MdPartCo::md_metadata [protected] |
Referenced by getContMember(), getMdProps(), getParent(), MdPartCo(), and setMetaData().
string storage::MdPartCo::md_uuid [protected] |
Referenced by equalContent(), getInfo(), getMdProps(), getMdUuid(), logDifference(), mdadmLine(), MdPartCo(), and updateEntry().
string storage::MdPartCo::sb_ver [protected] |
Referenced by doRemove(), equalContent(), getInfo(), logDifference(), MdPartCo(), and setMetaData().
bool storage::MdPartCo::destrSb [protected] |
Referenced by doRemove(), equalContent(), logDifference(), MdPartCo(), and removeMdPart().
std::list<string> storage::MdPartCo::devs [protected] |
Referenced by equalContent(), getDevs(), getInfo(), logDifference(), MdPartCo(), raidtabLines(), setMdDevs(), and setSpares().
std::list<string> storage::MdPartCo::spare [protected] |
Referenced by equalContent(), getDevs(), getSpareDevs(), logDifference(), MdPartCo(), raidtabLines(), and setSpares().
string storage::MdPartCo::md_names [static, protected] |
Initial value:
{ "unknown", "raid0", "raid1", "raid5", "raid6",
"raid10", "multipath" }
Referenced by logDifference(), pName(), and toMdType().
string storage::MdPartCo::par_names [static, protected] |
Initial value:
{ "none", "left-asymmetric", "left-symmetric",
"right-asymmetric", "right-symmetric" }
Referenced by logDifference(), ptName(), and toMdParity().
string storage::MdPartCo::md_states [static, protected] |
Initial value:
{"clear", "inactive", "suspended", "readonly",
"read-auto", "clean", "active", "write-pending",
"active-idle"}
Referenced by toMdArrayState().
unsigned storage::MdPartCo::md_major = 0 [static, protected] |
Referenced by getMdMajor(), and mdMajor().
string storage::MdPartCo::md_name [protected] |
Referenced by equalContent(), getInfo(), getMdProps(), logDifference(), MdPartCo(), storage::operator<<(), and updateEntry().
string storage::MdPartCo::sysfs_path = "/sys/devices/virtual/block/" [static, protected] |
Referenced by getMajorMinor(), getSlaves(), readProp(), and setMetaData().
string storage::MdPartCo::md_props [static, protected] |
Initial value:
{"metadata_version", "component_size", "chunk_size",
"array_state", "level", "layout" }
Referenced by readProp(), and setMetaData().
storage::MdPartCoInfo storage::MdPartCo::info [mutable, protected] |
bool storage::MdPartCo::active = false [static, protected] |
Referenced by activate(), doCreate(), doResize(), equalContent(), getDiffString(), isActive(), MdPartCo(), and storage::operator<<().
1.5.6