#include <MdCo.h>

Public Member Functions | |
| MdCo (Storage *const s) | |
| MdCo (Storage *const s, SystemInfo &systeminfo) | |
| MdCo (const MdCo &c) | |
| virtual | ~MdCo () |
| int | createMd (unsigned num, MdType type, const list< string > &devs, const list< string > &spares) |
| int | removeMd (unsigned num, bool destroySb=true) |
| int | extendMd (unsigned num, const list< string > &devs, const list< string > &spares) |
| int | shrinkMd (unsigned num, const list< string > &devs, const list< string > &spares) |
| 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) |
| int | getMdState (unsigned num, MdStateInfo &info) |
| bool | equalContent (const Container &rhs) const |
| virtual void | logDifferenceWithVolumes (std::ostream &log, const Container &rhs) const |
| void | syncMdadm (EtcMdadm *mdadm) const |
| void | changeDeviceName (const string &old, const string &nw) |
| int | removeVolume (Volume *v) |
| list< unsigned > | usedNumbers () const |
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 |
| 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 list< string > &dev, const list< string > &spares) const |
| void | addMd (Md *m) |
| virtual void | print (std::ostream &s) const |
| virtual Container * | getCopy () const |
| int | doCreate (Volume *v) |
| int | doRemove (Volume *v) |
| bool | isHandledByMdPart (const string &name) const |
Static Protected Attributes | |
| static bool | active = false |
Private Member Functions | |
| MdCo & | operator= (const MdCo &) |
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] |
| storage::MdCo::MdCo | ( | Storage *const | s, | |
| SystemInfo & | systeminfo | |||
| ) |
| storage::MdCo::MdCo | ( | const MdCo & | c | ) |
| storage::MdCo::~MdCo | ( | ) | [virtual] |
References storage::Device::dev, and y2deb.
| static storage::CType storage::MdCo::staticType | ( | ) | [inline, static] |
| int storage::MdCo::createMd | ( | unsigned | num, | |
| MdType | type, | |||
| const list< string > & | devs, | |||
| const list< string > & | spares | |||
| ) |
References storage::Container::addToList(), checkUse(), storage::decString(), findMd(), storage::MD_CHANGE_READONLY, storage::MD_DUPLICATE_NUMBER, storage::MD_NO_CREATE_UNKNOWN, storage::MD_NUMBER_TOO_LARGE, storage::Device::name(), storage::RAID_UNK, storage::Container::readonly(), storage::Device::setCreated(), storage::toString(), and y2mil.
Referenced by storage::Storage::createMd(), and storage::Storage::createMdAny().
| int storage::MdCo::removeMd | ( | unsigned | num, | |
| bool | destroySb = true | |||
| ) |
References storage::Storage::clearUsedBy(), 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(), and y2mil.
Referenced by storage::Storage::removeMd(), and removeVolume().
| int storage::MdCo::extendMd | ( | unsigned | num, | |
| const list< string > & | devs, | |||
| const list< string > & | spares | |||
| ) |
References storage::Storage::changeFormatVolume(), checkUse(), storage::Device::dev, findMd(), storage::FSNONE, storage::Container::getStorage(), storage::Storage::isDisk(), storage::MD_CHANGE_READONLY, storage::MD_NO_RESIZE_ON_DISK, storage::MD_UNKNOWN_NUMBER, storage::Container::readonly(), and y2mil.
Referenced by storage::Storage::extendMd().
| int storage::MdCo::shrinkMd | ( | unsigned | num, | |
| const list< string > & | devs, | |||
| const list< string > & | spares | |||
| ) |
References findMd(), storage::MD_CHANGE_READONLY, storage::MD_NO_RESIZE_ON_DISK, storage::MD_UNKNOWN_NUMBER, storage::Container::readonly(), and y2mil.
Referenced by storage::Storage::shrinkMd().
| int storage::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(), storage::toString(), and y2mil.
Referenced by storage::Storage::changeMdType().
| int storage::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 y2mil.
Referenced by storage::Storage::changeMdChunk().
| int storage::MdCo::changeMdParity | ( | unsigned | num, | |
| storage::MdParity | ptype | |||
| ) |
| int storage::MdCo::checkMd | ( | unsigned | num | ) |
References findMd(), storage::MD_DEVICE_UNKNOWN, and y2mil.
Referenced by storage::Storage::checkMd().
| int storage::MdCo::getMdState | ( | unsigned | num, | |
| MdStateInfo & | info | |||
| ) |
References findMd(), storage::MD_STATE_NOT_ON_DISK, storage::MD_UNKNOWN_NUMBER, and y2mil.
Referenced by storage::Storage::getMdStateInfo().
| bool storage::MdCo::equalContent | ( | const Container & | rhs | ) | const [virtual] |
Reimplemented from storage::Container.
References storage::IterPair< Iter >::begin(), storage::IterPair< Iter >::end(), storage::equalContent(), and mdPair().
| void storage::MdCo::logDifferenceWithVolumes | ( | std::ostream & | log, | |
| const Container & | rhs | |||
| ) | const [virtual] |
| void storage::MdCo::syncMdadm | ( | EtcMdadm * | mdadm | ) | const |
References storage::IterPair< Iter >::begin(), storage::IterPair< Iter >::end(), mdPair(), and storage::Md::notDeleted().
Referenced by storage::Storage::syncMdadm().
| void storage::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 storage::MdCo::activate | ( | bool | val, | |
| const string & | tmpDir | |||
| ) | [static] |
References active, storage::SystemCmd::execute(), MDADMBIN, storage::Storage::waitForDevice(), and y2mil.
Referenced by storage::MdPartCo::activate(), storage::Storage::detectObjects(), and storage::Storage::rescanEverything().
| int storage::MdCo::removeVolume | ( | Volume * | v | ) | [virtual] |
Reimplemented from storage::Container.
References storage::MD_REMOVE_INVALID_VOLUME, storage::Device::name(), storage::Volume::nr(), removeMd(), and y2mil.
| list< unsigned > storage::MdCo::usedNumbers | ( | ) | const |
References storage::IterPair< Iter >::begin(), storage::IterPair< Iter >::end(), mdPair(), and storage::Md::notDeleted().
Referenced by storage::Storage::checkMdNumber(), and storage::Storage::nextFreeMd().
References mdBegin(), and mdEnd().
Referenced by changeDeviceName(), equalContent(), findMd(), logDifferenceWithVolumes(), MdCo(), syncMdadm(), and usedNumbers().
| 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().
| bool storage::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(), createMd(), extendMd(), findMd(), getMdState(), removeMd(), and shrinkMd().
| bool storage::MdCo::findMd | ( | unsigned | num | ) | [protected] |
References findMd().
| bool storage::MdCo::findMd | ( | const string & | dev, | |
| MdIter & | i | |||
| ) | [protected] |
References findMd(), and storage::Md::mdStringNum().
| bool storage::MdCo::findMd | ( | const string & | dev | ) | [protected] |
References findMd().
| int storage::MdCo::checkUse | ( | const list< string > & | dev, | |
| const list< string > & | spares | |||
| ) | const [protected] |
References storage::Volume::canUseDevice(), storage::Container::getStorage(), storage::Storage::getVolume(), storage::MD_DEVICE_UNKNOWN, storage::MD_DEVICE_USED, and y2mil.
Referenced by createMd(), and extendMd().
| void storage::MdCo::addMd | ( | Md * | m | ) | [protected] |
References storage::Container::addToList(), findMd(), storage::Volume::nr(), and y2war.
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 storage::MdCo::doCreate | ( | Volume * | v | ) | [protected, virtual] |
Reimplemented from storage::Container.
References storage::Storage::getMdadm(), storage::Container::getStorage(), storage::MD_CREATE_FAILED, storage::MD_CREATE_INVALID_VOLUME, storage::Device::name(), storage::Storage::removeDmTableTo(), storage::SystemCmd::retcode(), storage::Container::setExtError(), storage::Storage::showInfoCb(), storage::Device::silent, storage::UB_LVM, storage::Storage::unaccessDev(), storage::EtcMdadm::updateEntry(), storage::Storage::waitForDevice(), y2mil, and storage::Storage::zeroDevice().
| int storage::MdCo::doRemove | ( | Volume * | v | ) | [protected, virtual] |
Reimplemented from storage::Container.
References storage::MdPartCo::activate(), active, storage::SystemCmd::execute(), storage::Storage::getMdadm(), storage::Container::getStorage(), storage::MD_NOT_IN_LIST, storage::MD_REMOVE_FAILED, storage::MD_REMOVE_INVALID_VOLUME, MDADMBIN, storage::Device::name(), storage::quote(), storage::EtcMdadm::removeEntry(), storage::Container::removeFromList(), storage::Container::setExtError(), storage::Storage::showInfoCb(), storage::Device::silent, and y2mil.
| bool storage::MdCo::isHandledByMdPart | ( | const string & | name | ) | const [protected] |
friend class Storage [friend] |
Reimplemented from storage::Container.
| std::ostream& operator<< | ( | std::ostream & | s, | |
| const MdCo & | d | |||
| ) | [friend] |
bool storage::MdCo::active = false [static, protected] |
Referenced by activate(), and doRemove().
1.5.6