#include <MdCo.h>

Public Member Functions | |
| MdCo (Storage *const s, bool detect) | |
| MdCo (const MdCo &rhs) | |
| virtual | ~MdCo () |
| int | createMd (unsigned num, storage::MdType type, const std::list< string > &devs) |
| int | removeMd (unsigned num, bool destroySb=true) |
| int | extendMd (unsigned num, const string &dev) |
| int | shrinkMd (unsigned num, const string &dev) |
| int | changeMdType (unsigned num, storage::MdType ptype) |
| int | changeMdChunk (unsigned num, unsigned long chunk) |
| int | changeMdParity (unsigned num, storage::MdParity ptype) |
| int | checkMd (unsigned num) |
| bool | equalContent (const Container &rhs) const |
| void | logDifference (const Container &d) const |
| unsigned | unusedNumber () |
| void | syncRaidtab () |
| void | changeDeviceName (const string &old, const string &nw) |
| int | removeVolume (Volume *v) |
Static Public Member Functions | |
| static storage::CType | staticType () |
| static void | activate (bool val, const string &tmpDir) |
Protected Types | |
| typedef CastIterator< VIter, Md * > | MdInter |
| typedef CastIterator< CVIter, const Md * > | MdCInter |
| typedef CheckFnc< const Md > | CheckFncMd |
| typedef CheckerIterator < CheckFncMd, MdPI< CheckFncMd > ::type, MdInter, Md > | MdPIterator |
| typedef CheckerIterator < CheckFncMd, MdCPI < CheckFncMd >::type, MdCInter, const Md > | MdCPIterator |
| typedef DerefIterator < MdPIterator, Md > | MdIter |
| typedef DerefIterator < MdCPIterator, const Md > | ConstMdIter |
| typedef IterPair< MdIter > | MdPair |
| typedef IterPair< ConstMdIter > | ConstMdPair |
Protected Member Functions | |
| MdPair | mdPair (bool(*Check)(const Md &)=NULL) |
| MdIter | mdBegin (bool(*Check)(const Md &)=NULL) |
| MdIter | mdEnd (bool(*Check)(const Md &)=NULL) |
| ConstMdPair | mdPair (bool(*Check)(const Md &)=NULL) const |
| ConstMdIter | mdBegin (bool(*Check)(const Md &)=NULL) const |
| ConstMdIter | mdEnd (bool(*Check)(const Md &)=NULL) const |
| MdCo (Storage *const s, const string &File) | |
| void | getMdData () |
| void | getMdData (unsigned num) |
| bool | findMd (unsigned num, MdIter &i) |
| bool | findMd (unsigned num) |
| bool | findMd (const string &dev, MdIter &i) |
| bool | findMd (const string &dev) |
| int | checkUse (const string &dev) |
| void | addMd (Md *m) |
| void | checkMd (Md *m) |
| void | updateEntry (const Md *m) |
| void | initTab () |
| void | init () |
| virtual void | print (std::ostream &s) const |
| virtual Container * | getCopy () const |
| int | doCreate (Volume *v) |
| int | doRemove (Volume *v) |
| void | logData (const string &Dir) |
Protected Attributes | |
| EtcRaidtab * | tab |
Static Protected Attributes | |
| static bool | active = false |
Friends | |
| class | Storage |
| std::ostream & | operator<< (std::ostream &, const MdCo &) |
Classes | |
| struct | MdCPI |
| struct | MdPI |
typedef CastIterator<VIter, Md *> storage::MdCo::MdInter [protected] |
typedef CastIterator<CVIter, const Md *> storage::MdCo::MdCInter [protected] |
typedef CheckFnc<const Md> storage::MdCo::CheckFncMd [protected] |
typedef CheckerIterator< CheckFncMd, MdPI<CheckFncMd>::type, MdInter, Md > storage::MdCo::MdPIterator [protected] |
typedef CheckerIterator< CheckFncMd, MdCPI<CheckFncMd>::type, MdCInter, const Md > storage::MdCo::MdCPIterator [protected] |
typedef DerefIterator<MdPIterator,Md> storage::MdCo::MdIter [protected] |
typedef DerefIterator<MdCPIterator,const Md> storage::MdCo::ConstMdIter [protected] |
typedef IterPair<MdIter> storage::MdCo::MdPair [protected] |
typedef IterPair<ConstMdIter> storage::MdCo::ConstMdPair [protected] |
| MdCo::MdCo | ( | Storage *const | s, | |
| bool | detect | |||
| ) |
| MdCo::MdCo | ( | const MdCo & | rhs | ) |
| static storage::CType storage::MdCo::staticType | ( | ) | [inline, static] |
| int storage::MdCo::createMd | ( | unsigned | num, | |
| storage::MdType | type, | |||
| const std::list< string > & | devs | |||
| ) |
Referenced by storage::Storage::createMd(), and storage::Storage::createMdAny().
| int MdCo::removeMd | ( | unsigned | num, | |
| bool | destroySb = true | |||
| ) |
References findMd(), storage::Container::getStorage(), storage::MD_CHANGE_READONLY, storage::MD_REMOVE_CREATE_NOT_FOUND, storage::MD_REMOVE_USED_BY, storage::MD_UNKNOWN_NUMBER, storage::Container::readonly(), storage::Container::removeFromList(), storage::Storage::setUsedBy(), storage::UB_NONE, and y2milestone.
Referenced by storage::Storage::removeMd(), and removeVolume().
| int MdCo::extendMd | ( | unsigned | num, | |
| const string & | dev | |||
| ) |
References storage::Storage::changeFormatVolume(), checkUse(), storage::decString(), findMd(), storage::FSNONE, storage::Container::getStorage(), storage::MD_CHANGE_READONLY, storage::MD_NO_RESIZE_ON_DISK, storage::MD_UNKNOWN_NUMBER, storage::normalizeDevice(), storage::Container::readonly(), storage::Storage::setUsedBy(), storage::UB_MD, and y2milestone.
Referenced by storage::Storage::extendMd().
| int MdCo::shrinkMd | ( | unsigned | num, | |
| const string & | dev | |||
| ) |
References findMd(), storage::Container::getStorage(), storage::MD_CHANGE_READONLY, storage::MD_NO_RESIZE_ON_DISK, storage::MD_UNKNOWN_NUMBER, storage::normalizeDevice(), storage::Container::readonly(), storage::Storage::setUsedBy(), storage::UB_NONE, and y2milestone.
Referenced by storage::Storage::shrinkMd().
| int MdCo::changeMdType | ( | unsigned | num, | |
| storage::MdType | ptype | |||
| ) |
References findMd(), storage::MD_CHANGE_READONLY, storage::MD_NO_CHANGE_ON_DISK, storage::MD_UNKNOWN_NUMBER, storage::Container::readonly(), and y2milestone.
Referenced by storage::Storage::changeMdType().
| int MdCo::changeMdChunk | ( | unsigned | num, | |
| unsigned long | chunk | |||
| ) |
References findMd(), storage::MD_CHANGE_READONLY, storage::MD_NO_CHANGE_ON_DISK, storage::MD_UNKNOWN_NUMBER, storage::Container::readonly(), and y2milestone.
Referenced by storage::Storage::changeMdChunk().
| int MdCo::changeMdParity | ( | unsigned | num, | |
| storage::MdParity | ptype | |||
| ) |
References findMd(), storage::MD_CHANGE_READONLY, storage::MD_NO_RESIZE_ON_DISK, storage::MD_UNKNOWN_NUMBER, storage::Container::readonly(), and y2milestone.
Referenced by storage::Storage::changeMdParity().
| int MdCo::checkMd | ( | unsigned | num | ) |
References findMd(), storage::MD_DEVICE_UNKNOWN, and y2milestone.
Referenced by storage::Storage::checkMd(), and getMdData().
| bool MdCo::equalContent | ( | const Container & | rhs | ) | const [virtual] |
Reimplemented from storage::Container.
References storage::IterPair< Iter >::begin(), storage::IterPair< Iter >::end(), storage::Container::equalContent(), and mdPair().
| void MdCo::logDifference | ( | const Container & | d | ) | const [virtual] |
Reimplemented from storage::Container.
References storage::IterPair< Iter >::begin(), storage::IterPair< Iter >::end(), storage::Container::getDiffString(), mdPair(), and y2mil.
| unsigned MdCo::unusedNumber | ( | ) |
| void MdCo::syncRaidtab | ( | ) |
| void MdCo::changeDeviceName | ( | const string & | old, | |
| const string & | nw | |||
| ) | [virtual] |
Reimplemented from storage::Container.
References storage::IterPair< Iter >::begin(), storage::IterPair< Iter >::end(), and mdPair().
| void MdCo::activate | ( | bool | val, | |
| const string & | tmpDir | |||
| ) | [static] |
References active, storage::SystemCmd::execute(), and y2milestone.
Referenced by storage::Storage::activateHld(), storage::Storage::detectObjects(), and doRemove().
| int MdCo::removeVolume | ( | Volume * | v | ) | [virtual] |
Reimplemented from storage::Container.
References storage::MD_REMOVE_INVALID_VOLUME, storage::Volume::name(), storage::Volume::nr(), removeMd(), and y2milestone.
References mdBegin(), and mdEnd().
Referenced by changeDeviceName(), equalContent(), findMd(), getMdData(), logDifference(), MdCo(), and syncRaidtab().
| ConstMdPair storage::MdCo::mdPair | ( | bool(*)(const Md &) | Check = NULL |
) | const [inline, protected] |
| ConstMdIter storage::MdCo::mdBegin | ( | bool(*)(const Md &) | Check = NULL |
) | const [inline, protected] |
References storage::Container::begin(), and storage::Container::end().
| ConstMdIter storage::MdCo::mdEnd | ( | bool(*)(const Md &) | Check = NULL |
) | const [inline, protected] |
References storage::Container::begin(), and storage::Container::end().
| void MdCo::getMdData | ( | ) | [protected] |
References addMd(), storage::IterPair< Iter >::begin(), storage::decString(), storage::Container::device(), storage::IterPair< Iter >::end(), storage::extractNthWord(), findMd(), getline(), storage::Container::getStorage(), mdPair(), storage::Md::mdStringNum(), storage::normalizeDevice(), storage::Md::notDeleted(), storage::Storage::setUsedBy(), storage::UB_MD, y2mil, y2milestone, and y2warning.
Referenced by doCreate(), and MdCo().
| void MdCo::getMdData | ( | unsigned | num | ) | [protected] |
References checkMd(), storage::decString(), storage::extractNthWord(), getline(), y2mil, and y2milestone.
| bool MdCo::findMd | ( | unsigned | num, | |
| MdIter & | i | |||
| ) | [protected] |
References storage::IterPair< Iter >::begin(), storage::IterPair< Iter >::end(), mdPair(), and storage::Md::notDeleted().
Referenced by addMd(), changeMdChunk(), changeMdParity(), changeMdType(), checkMd(), extendMd(), findMd(), getMdData(), removeMd(), shrinkMd(), and unusedNumber().
| bool MdCo::findMd | ( | unsigned | num | ) | [protected] |
References findMd().
| bool MdCo::findMd | ( | const string & | dev, | |
| MdIter & | i | |||
| ) | [protected] |
References findMd(), and storage::Md::mdStringNum().
| bool MdCo::findMd | ( | const string & | dev | ) | [protected] |
References findMd().
| int MdCo::checkUse | ( | const string & | dev | ) | [protected] |
References storage::Volume::canUseDevice(), storage::Container::getStorage(), storage::Storage::getVolume(), storage::MD_DEVICE_UNKNOWN, storage::MD_DEVICE_USED, and y2milestone.
Referenced by extendMd().
| void MdCo::addMd | ( | Md * | m | ) | [protected] |
References storage::Container::addToList(), findMd(), storage::Volume::nr(), and y2warning.
Referenced by getMdData().
| void MdCo::checkMd | ( | Md * | m | ) | [protected] |
| void MdCo::updateEntry | ( | const Md * | m | ) | [protected] |
References storage::Md::getDevs(), initTab(), storage::Md::mdadmLine(), storage::Volume::nr(), storage::Md::raidtabLines(), tab, and storage::EtcRaidtab::updateEntry().
Referenced by doCreate(), and syncRaidtab().
| void MdCo::initTab | ( | ) | [protected] |
References storage::Container::getStorage(), and tab.
Referenced by doRemove(), init(), and updateEntry().
| void MdCo::init | ( | ) | [protected] |
References initTab(), storage::Md::mdMajor(), storage::Container::mjr, and tab.
Referenced by MdCo().
| virtual void storage::MdCo::print | ( | std::ostream & | s | ) | const [inline, protected, virtual] |
Reimplemented from storage::Container.
| virtual Container* storage::MdCo::getCopy | ( | ) | const [inline, protected, virtual] |
| int MdCo::doCreate | ( | Volume * | v | ) | [protected, virtual] |
Reimplemented from storage::Container.
References storage::decString(), storage::SystemCmd::execute(), getMdData(), storage::Container::getStorage(), storage::MD_CREATE_FAILED, storage::MD_CREATE_INVALID_VOLUME, storage::Volume::name(), storage::Storage::removeDmTableTo(), storage::SystemCmd::retcode(), storage::Container::setExtError(), storage::Storage::showInfoCb(), storage::Container::silent, storage::UB_EVMS, storage::UB_LVM, updateEntry(), storage::Storage::waitForDevice(), and y2milestone.
| int MdCo::doRemove | ( | Volume * | v | ) | [protected, virtual] |
Reimplemented from storage::Container.
References activate(), active, storage::SystemCmd::execute(), storage::Container::getStorage(), initTab(), storage::MD_NOT_IN_LIST, storage::MD_REMOVE_FAILED, storage::MD_REMOVE_INVALID_VOLUME, storage::Volume::name(), storage::EtcRaidtab::removeEntry(), storage::Container::removeFromList(), storage::SystemCmd::retcode(), storage::Container::setExtError(), storage::Storage::showInfoCb(), storage::Container::silent, tab, and y2milestone.
| void MdCo::logData | ( | const string & | Dir | ) | [protected, virtual] |
Reimplemented from storage::Container.
friend class Storage [friend] |
Reimplemented from storage::Container.
| std::ostream& operator<< | ( | std::ostream & | s, | |
| const MdCo & | d | |||
| ) | [friend] |
EtcRaidtab* storage::MdCo::tab [protected] |
Referenced by doRemove(), init(), initTab(), MdCo(), syncRaidtab(), updateEntry(), and ~MdCo().
bool MdCo::active = false [static, protected] |
Referenced by activate(), and doRemove().
1.5.5