#include <Md.h>

Public Member Functions | |
| Md (const MdCo &d, unsigned Pnr, storage::MdType Type, const std::list< string > &devs) | |
| Md (const MdCo &d, const string &line, const string &line2) | |
| Md (const MdCo &d, const Md &m) | |
| virtual | ~Md () |
| storage::MdType | personality () const |
| void | setPersonality (storage::MdType val) |
| storage::MdParity | parity () const |
| void | setParity (storage::MdParity val) |
| unsigned long | chunkSize () const |
| void | setChunkSize (unsigned long val) |
| void | setMdUuid (const string &val) |
| bool | destroySb () const |
| void | setDestroySb (bool val=true) |
| const string & | getMdUuid () const |
| const string & | pName () const |
| const string & | ptName () const |
| void | getDevs (std::list< string > &devices, bool all=true, bool spare=false) const |
| void | addSpareDevice (const string &dev) |
| int | checkDevices () |
| int | addDevice (const string &dev, bool spare=false) |
| int | removeDevice (const string &dev) |
| void | raidtabLines (std::list< string > &) const |
| string | mdadmLine () const |
| string | createCmd () const |
| virtual void | print (std::ostream &s) const |
| string | removeText (bool doing) const |
| string | createText (bool doing) const |
| string | formatText (bool doing) const |
| void | changeDeviceName (const string &old, const string &nw) |
| void | getInfo (storage::MdInfo &info) const |
| bool | equalContent (const Md &rhs) const |
| void | logDifference (const Md &d) const |
Static Public Member Functions | |
| static bool | matchRegex (const string &dev) |
| static unsigned | mdMajor () |
| static const string & | pName (storage::MdType t) |
| static bool | mdStringNum (const string &name, unsigned &num) |
| static bool | notDeleted (const Md &l) |
Protected Member Functions | |
| void | init () |
| void | computeSize () |
| Md & | operator= (const Md &) |
Static Protected Member Functions | |
| static void | getMdMajor () |
| static storage::MdType | toMdType (const string &val) |
| static storage::MdParity | toMdParity (const string &val) |
Protected Attributes | |
| storage::MdType | md_type |
| storage::MdParity | md_parity |
| unsigned long | chunk |
| string | md_uuid |
| string | sb_ver |
| bool | destrSb |
| std::list< string > | devs |
| std::list< string > | spare |
| storage::MdInfo | info |
Static Protected Attributes | |
| static string | md_names [storage::MULTIPATH+1] |
| static string | par_names [storage::RIGHT_SYMMETRIC+1] |
| static unsigned | md_major = 0 |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const Md &m) |
| storage::Md::Md | ( | const MdCo & | d, | |
| unsigned | Pnr, | |||
| storage::MdType | Type, | |||
| const std::list< string > & | devs | |||
| ) |
| Md::Md | ( | const MdCo & | d, | |
| const string & | line, | |||
| const string & | line2 | |||
| ) |
References storage::app_ws, chunk, storage::Volume::dev, storage::Volume::device(), devs, storage::extractNthWord(), storage::SystemCmd::getLine(), storage::Volume::getMajorMinor(), init(), storage::LEFT_ASYMMETRIC, storage::LEFT_SYMMETRIC, storage::MD, md_parity, md_type, md_uuid, mdStringNum(), storage::Volume::mjr, storage::Volume::mnr, storage::Volume::nm, storage::normalizeDevice(), storage::Volume::nr(), storage::Volume::num, storage::SystemCmd::numLines(), storage::PAR_NONE, storage::RAID_UNK, storage::SystemCmd::retcode(), storage::RIGHT_ASYMMETRIC, storage::RIGHT_SYMMETRIC, sb_ver, storage::SystemCmd::select(), storage::Volume::setNameDev(), storage::Volume::setReadonly(), storage::Volume::setSize(), toMdType(), storage::Container::type(), y2error, y2mil, y2milestone, and y2warning.
References storage::Volume::dev, and y2debug.
| Md::~Md | ( | ) | [virtual] |
References storage::Volume::dev, and y2debug.
| storage::MdType storage::Md::personality | ( | ) | const [inline] |
| void Md::setPersonality | ( | storage::MdType | val | ) |
References computeSize(), and md_type.
| storage::MdParity storage::Md::parity | ( | ) | const [inline] |
| void storage::Md::setParity | ( | storage::MdParity | val | ) | [inline] |
References md_parity.
| unsigned long storage::Md::chunkSize | ( | ) | const [inline] |
| void storage::Md::setChunkSize | ( | unsigned long | val | ) | [inline] |
References chunk.
| void storage::Md::setMdUuid | ( | const string & | val | ) | [inline] |
References md_uuid.
| bool storage::Md::destroySb | ( | ) | const [inline] |
References destrSb.
| void storage::Md::setDestroySb | ( | bool | val = true |
) | [inline] |
References destrSb.
| const string& storage::Md::getMdUuid | ( | ) | const [inline] |
| const string& storage::Md::pName | ( | ) | const [inline] |
References md_names, and md_type.
Referenced by storage::MdCo::checkMd(), createCmd(), storage::Storage::createMd(), storage::Storage::createMdAny(), mdadmLine(), and storage::operator<<().
| const string& storage::Md::ptName | ( | ) | const [inline] |
References md_parity, and par_names.
Referenced by storage::MdCo::checkMd(), createCmd(), and storage::operator<<().
| void storage::Md::getDevs | ( | std::list< string > & | devices, | |
| bool | all = true, |
|||
| bool | spare = false | |||
| ) | const |
Referenced by storage::MdCo::updateEntry().
| void Md::addSpareDevice | ( | const string & | dev | ) |
References devs, storage::normalizeDevice(), spare, and y2warning.
| int Md::checkDevices | ( | ) |
References devs, storage::MD_TOO_FEW_DEVICES, md_type, storage::RAID5, storage::RAID6, and y2milestone.
| int Md::addDevice | ( | const string & | dev, | |
| bool | spare = false | |||
| ) |
References computeSize(), devs, storage::MD_ADD_DUPLICATE, storage::normalizeDevice(), spare, and y2milestone.
| int Md::removeDevice | ( | const string & | dev | ) |
References computeSize(), devs, storage::MD_REMOVE_NONEXISTENT, storage::normalizeDevice(), spare, and y2milestone.
| void storage::Md::raidtabLines | ( | std::list< string > & | ) | const |
Referenced by storage::MdCo::updateEntry().
| string Md::mdadmLine | ( | ) | const |
References storage::Volume::device(), md_uuid, pName(), and y2milestone.
Referenced by storage::MdCo::updateEntry().
| string Md::createCmd | ( | ) | const |
References chunk, storage::decString(), storage::Volume::device(), devs, md_parity, storage::PAR_NONE, pName(), ptName(), spare, and y2milestone.
| bool Md::matchRegex | ( | const string & | dev | ) | [static] |
| unsigned Md::mdMajor | ( | ) | [static] |
References getMdMajor(), and md_major.
Referenced by storage::MdCo::init(), isMdMajor(), and storage::Evms::updateMd().
| static const string& storage::Md::pName | ( | storage::MdType | t | ) | [inline, static] |
References md_names.
| bool Md::mdStringNum | ( | const string & | name, | |
| unsigned & | num | |||
| ) | [static] |
References matchRegex(), and storage::undevDevice().
Referenced by storage::EtcRaidtab::buildMdadmMap(), storage::Storage::changeMdChunk(), storage::Storage::changeMdParity(), storage::Storage::changeMdType(), storage::Storage::checkMd(), storage::Storage::createMd(), storage::Storage::extendMd(), storage::MdCo::findMd(), storage::MdCo::getMdData(), Md(), storage::Storage::removeMd(), and storage::Storage::shrinkMd().
| virtual void storage::Md::print | ( | std::ostream & | s | ) | const [inline, virtual] |
Reimplemented from storage::Volume.
| string Md::removeText | ( | bool | doing | ) | const [virtual] |
Reimplemented from storage::Volume.
References storage::_(), storage::Volume::dev, storage::sformat(), and storage::Volume::sizeString().
| string Md::createText | ( | bool | doing | ) | const [virtual] |
Reimplemented from storage::Volume.
References storage::_(), storage::Volume::dev, storage::ENC_NONE, storage::Volume::encryption, storage::Volume::fsTypeString(), storage::Volume::mp, storage::sformat(), and storage::Volume::sizeString().
| string Md::formatText | ( | bool | doing | ) | const [virtual] |
Reimplemented from storage::Volume.
References storage::_(), storage::Volume::dev, storage::ENC_NONE, storage::Volume::encryption, storage::Volume::fsTypeString(), storage::Volume::mp, storage::sformat(), and storage::Volume::sizeString().
| static bool storage::Md::notDeleted | ( | const Md & | l | ) | [inline, static] |
References storage::Volume::deleted().
Referenced by storage::MdCo::findMd(), storage::MdCo::getMdData(), storage::Storage::getMdInfo(), and storage::MdCo::syncRaidtab().
| void Md::getInfo | ( | storage::MdInfo & | info | ) | const |
| bool Md::equalContent | ( | const Md & | rhs | ) | const |
| void Md::logDifference | ( | const Md & | d | ) | const |
References chunk, storage::decString(), destrSb, devs, storage::Volume::logDifference(), md_names, md_parity, md_type, md_uuid, par_names, sb_ver, spare, and y2milestone.
| void Md::init | ( | ) | [protected] |
Reimplemented from storage::Volume.
References chunk, destrSb, md_parity, md_type, storage::PAR_NONE, storage::RAID_UNK, and sb_ver.
Referenced by Md().
| void Md::computeSize | ( | ) | [protected] |
References devs, storage::Volume::getContainer(), storage::Container::getStorage(), storage::Storage::getVolume(), md_type, storage::MULTIPATH, storage::RAID0, storage::RAID1, storage::RAID10, storage::RAID5, storage::RAID6, storage::Volume::setSize(), storage::Volume::sizeK(), and y2milestone.
Referenced by addDevice(), removeDevice(), and setPersonality().
| void Md::getMdMajor | ( | ) | [static, protected] |
| MdType Md::toMdType | ( | const string & | val | ) | [static, protected] |
| MdParity Md::toMdParity | ( | const string & | val | ) | [static, protected] |
References par_names, storage::PAR_NONE, and storage::RIGHT_SYMMETRIC.
| std::ostream& operator<< | ( | std::ostream & | s, | |
| const Md & | m | |||
| ) | [friend] |
storage::MdType storage::Md::md_type [protected] |
Referenced by checkDevices(), computeSize(), equalContent(), getInfo(), init(), logDifference(), Md(), operator=(), personality(), pName(), and setPersonality().
storage::MdParity storage::Md::md_parity [protected] |
Referenced by createCmd(), equalContent(), getInfo(), init(), logDifference(), Md(), storage::operator<<(), operator=(), parity(), ptName(), and setParity().
unsigned long storage::Md::chunk [protected] |
Referenced by chunkSize(), createCmd(), equalContent(), getInfo(), init(), logDifference(), Md(), storage::operator<<(), operator=(), and setChunkSize().
string storage::Md::md_uuid [protected] |
Referenced by equalContent(), getInfo(), getMdUuid(), logDifference(), Md(), mdadmLine(), storage::operator<<(), operator=(), and setMdUuid().
string storage::Md::sb_ver [protected] |
Referenced by equalContent(), getInfo(), init(), logDifference(), Md(), storage::operator<<(), and operator=().
bool storage::Md::destrSb [protected] |
Referenced by destroySb(), equalContent(), init(), logDifference(), storage::operator<<(), operator=(), and setDestroySb().
std::list<string> storage::Md::devs [protected] |
Referenced by addDevice(), addSpareDevice(), changeDeviceName(), checkDevices(), computeSize(), createCmd(), equalContent(), getInfo(), logDifference(), Md(), storage::operator<<(), operator=(), and removeDevice().
std::list<string> storage::Md::spare [protected] |
Referenced by addDevice(), addSpareDevice(), changeDeviceName(), createCmd(), equalContent(), logDifference(), storage::operator<<(), operator=(), and removeDevice().
string Md::md_names [static, protected] |
Initial value:
{ "unknown", "raid0", "raid1", "raid5", "raid6",
"raid10", "multipath" }
Referenced by logDifference(), pName(), and toMdType().
string Md::par_names [static, protected] |
Initial value:
{ "none", "left-asymmetric", "left-symmetric",
"right-asymmetric", "right-symmetric" }
Referenced by logDifference(), ptName(), and toMdParity().
unsigned Md::md_major = 0 [static, protected] |
Referenced by getMdMajor(), and mdMajor().
storage::MdInfo storage::Md::info [mutable, protected] |
1.5.5