#include <PeContainer.h>

Public Member Functions | |
| PeContainer (Storage *s, const string &name, const string &device, CType t) | |
| PeContainer (Storage *s, const string &name, const string &device, CType t, SystemInfo &systeminfo) | |
| PeContainer (Storage *s, CType t, const xmlNode *node) | |
| PeContainer (const PeContainer &c) | |
| virtual | ~PeContainer () |
| void | saveData (xmlNode *node) const |
| unsigned long long | peSize () const |
| unsigned long | peCount () const |
| unsigned long | peFree () const |
| unsigned | numPv () const |
| bool | addedPv (const string &dev) const |
| unsigned long | sizeToLe (unsigned long long sizeK) const |
| int | setPeSize (long long unsigned, bool lvm1) |
| void | calcSize () |
| void | unuseDev () const |
| void | changeDeviceName (const string &old, const string &nw) |
| bool | equalContent (const PeContainer &rhs, bool comp_vol=true) const |
| void | logDifference (std::ostream &log, const PeContainer &rhs) const |
| string | getDeviceByNumber (const string &majmin) const |
| virtual list< string > | getUsing () const |
Protected Types | |
| typedef CastIterator< VIter, Dm * > | DmInter |
| typedef CastIterator< CVIter, const Dm * > | DmCInter |
| typedef CheckFnc< const Dm > | CheckFncDm |
| typedef CheckerIterator < CheckFncDm, DmPI< CheckFncDm > ::type, DmInter, Dm > | DmPIterator |
| typedef CheckerIterator < CheckFncDm, DmCPI < CheckFncDm >::type, DmCInter, const Dm > | DmCPIterator |
| typedef DerefIterator < DmPIterator, Dm > | DmIter |
| typedef DerefIterator < DmCPIterator, const Dm > | ConstDmIter |
| typedef IterPair< DmIter > | DmPair |
| typedef IterPair< ConstDmIter > | ConstDmPair |
Protected Member Functions | |
| DmPair | dmPair (bool(*Check)(const Dm &)=NULL) |
| DmIter | dmBegin (bool(*Check)(const Dm &)=NULL) |
| DmIter | dmEnd (bool(*Check)(const Dm &)=NULL) |
| ConstDmPair | dmPair (bool(*Check)(const Dm &)=NULL) const |
| ConstDmIter | dmBegin (bool(*Check)(const Dm &)=NULL) const |
| ConstDmIter | dmEnd (bool(*Check)(const Dm &)=NULL) const |
| string | addList () const |
| virtual void | print (std::ostream &s) const |
| virtual Container * | getCopy () const =0 |
| bool | findPe (const string &dev, const list< Pv > &pl, list< Pv >::const_iterator &i) const |
| bool | findPe (const string &dev, list< Pv > &pl, list< Pv >::iterator &i) const |
| unsigned long | leByLvRemove () const |
| int | tryUnusePe (const string &dev, std::list< Pv > &pl, std::list< Pv > &pladd, std::list< Pv > &plrem, unsigned long &removed_pe) |
| bool | checkCreateConstraints () |
| int | remLvPeDistribution (unsigned long le, std::map< string, unsigned long > &pe_map, std::list< Pv > &pl, std::list< Pv > &pladd) |
| virtual bool | checkConsistency () const |
| void | addPv (const Pv &p) |
Static Protected Member Functions | |
| static int | addLvPeDistribution (unsigned long le, unsigned stripe, std::list< Pv > &pl, std::list< Pv > &pladd, std::map< string, unsigned long > &pe_map) |
Protected Attributes | |
| unsigned long long | pe_size |
| unsigned long | num_pe |
| unsigned long | free_pe |
| std::list< Pv > | pv |
| std::list< Pv > | pv_add |
| std::list< Pv > | pv_remove |
Private Member Functions | |
| PeContainer & | operator= (const PeContainer &) |
Friends | |
| class | Storage |
| std::ostream & | operator<< (std::ostream &, const PeContainer &) |
| std::ostream & | operator<< (std::ostream &, const Pv &) |
| void | printDevList (std::ostream &, const std::list< Pv > &) |
Classes | |
| struct | DmCPI |
| struct | DmPI |
| struct | Pv |
typedef CastIterator<VIter, Dm *> storage::PeContainer::DmInter [protected] |
typedef CastIterator<CVIter, const Dm *> storage::PeContainer::DmCInter [protected] |
typedef CheckFnc<const Dm> storage::PeContainer::CheckFncDm [protected] |
typedef CheckerIterator< CheckFncDm, DmPI<CheckFncDm>::type, DmInter, Dm > storage::PeContainer::DmPIterator [protected] |
typedef CheckerIterator< CheckFncDm, DmCPI<CheckFncDm>::type, DmCInter, const Dm > storage::PeContainer::DmCPIterator [protected] |
typedef DerefIterator<DmPIterator,Dm> storage::PeContainer::DmIter [protected] |
typedef DerefIterator<DmCPIterator,const Dm> storage::PeContainer::ConstDmIter [protected] |
typedef IterPair<DmIter> storage::PeContainer::DmPair [protected] |
typedef IterPair<ConstDmIter> storage::PeContainer::ConstDmPair [protected] |
| storage::PeContainer::PeContainer | ( | Storage * | s, | |
| const string & | name, | |||
| const string & | device, | |||
| CType | t | |||
| ) |
References storage::toString(), and y2deb.
| storage::PeContainer::PeContainer | ( | Storage * | s, | |
| const string & | name, | |||
| const string & | device, | |||
| CType | t, | |||
| SystemInfo & | systeminfo | |||
| ) |
References storage::toString(), and y2deb.
References storage::Storage::addUsedBy(), storage::Device::dev, storage::PeContainer::Pv::device, storage::DM, storage::DMMULTIPATH, storage::DMRAID, free_pe, storage::getChildNodes(), storage::getChildValue(), storage::LVM, num_pe, pe_size, pv, storage::UB_DM, storage::UB_DMMULTIPATH, storage::UB_DMRAID, storage::UB_LVM, and y2deb.
| storage::PeContainer::PeContainer | ( | const PeContainer & | c | ) |
References storage::Device::dev, and y2deb.
| storage::PeContainer::~PeContainer | ( | ) | [virtual] |
References storage::Device::dev, and y2deb.
| void storage::PeContainer::saveData | ( | xmlNode * | node | ) | const |
Reimplemented from storage::Container.
Reimplemented in storage::LvmVg.
References peCount(), peFree(), peSize(), pv, storage::Container::saveData(), storage::setChildValue(), and storage::xmlNewChild().
Referenced by storage::LvmVg::saveData().
| unsigned long long storage::PeContainer::peSize | ( | ) | const [inline] |
References pe_size.
Referenced by storage::LvmVg::getInfo(), storage::LvmLv::getInfo(), storage::Dm::getTableInfo(), and saveData().
| unsigned long storage::PeContainer::peCount | ( | ) | const [inline] |
| unsigned long storage::PeContainer::peFree | ( | ) | const [inline] |
| unsigned storage::PeContainer::numPv | ( | ) | const [inline] |
References pv.
| bool storage::PeContainer::addedPv | ( | const string & | dev | ) | const |
| unsigned long storage::PeContainer::sizeToLe | ( | unsigned long long | sizeK | ) | const |
| int storage::PeContainer::setPeSize | ( | long long | unsigned, | |
| bool | lvm1 | |||
| ) |
Referenced by storage::LvmVg::setPeSize().
| void storage::PeContainer::calcSize | ( | ) | [inline] |
References num_pe, pe_size, and storage::Device::size_k.
Referenced by storage::LvmVg::extendVg(), storage::LvmVg::getVgData(), and storage::LvmVg::reduceVg().
| void storage::PeContainer::unuseDev | ( | ) | const |
References storage::Storage::clearUsedBy(), storage::Container::getStorage(), pv, and pv_add.
Referenced by storage::DmPartCo::removeDmPart(), and storage::LvmVg::removeVg().
| void storage::PeContainer::changeDeviceName | ( | const string & | old, | |
| const string & | nw | |||
| ) | [virtual] |
| bool storage::PeContainer::equalContent | ( | const PeContainer & | rhs, | |
| bool | comp_vol = true | |||
| ) | const |
References storage::IterPair< Iter >::begin(), dmPair(), storage::IterPair< Iter >::end(), storage::equalContent(), free_pe, num_pe, pe_size, pv, pv_add, and pv_remove.
| void storage::PeContainer::logDifference | ( | std::ostream & | log, | |
| const PeContainer & | rhs | |||
| ) | const |
References storage::contains(), for(), free_pe, storage::logDiff(), storage::Container::logDifference(), num_pe, pe_size, pv, pv_add, and pv_remove.
Referenced by storage::LvmVg::logDifference(), storage::DmPartCo::logDifference(), and storage::DmCo::logDifferenceWithVolumes().
| string storage::PeContainer::getDeviceByNumber | ( | const string & | majmin | ) | const |
References storage::classic(), storage::Device::device(), storage::Storage::deviceByNumber(), storage::Container::getStorage(), storage::Loop::loopDeviceName(), storage::Loop::loopMajor(), storage::Device::majorNr(), storage::Device::minorNr(), storage::splitString(), and y2mil.
Referenced by storage::Dm::getTableInfo(), and storage::LvmVg::normalizeDmDevices().
| list< string > storage::PeContainer::getUsing | ( | ) | const [virtual] |
References dmBegin(), and dmEnd().
Referenced by changeDeviceName(), checkConsistency(), checkCreateConstraints(), storage::DmCo::DmCo(), equalContent(), storage::DmCo::equalContent(), storage::DmCo::findDm(), leByLvRemove(), storage::DmCo::logDifferenceWithVolumes(), tryUnusePe(), and storage::DmCo::updateDmMaps().
| ConstDmPair storage::PeContainer::dmPair | ( | bool(*)(const Dm &) | Check = NULL |
) | const [inline, protected] |
| ConstDmIter storage::PeContainer::dmBegin | ( | bool(*)(const Dm &) | Check = NULL |
) | const [inline, protected] |
References storage::Container::begin(), and storage::Container::end().
| ConstDmIter storage::PeContainer::dmEnd | ( | bool(*)(const Dm &) | Check = NULL |
) | const [inline, protected] |
References storage::Container::begin(), and storage::Container::end().
| string storage::PeContainer::addList | ( | ) | const [protected] |
| virtual void storage::PeContainer::print | ( | std::ostream & | s | ) | const [inline, protected, virtual] |
Reimplemented from storage::Container.
Reimplemented in storage::DmCo, storage::DmmultipathCo, storage::DmPartCo, storage::DmraidCo, and storage::LvmVg.
| virtual Container* storage::PeContainer::getCopy | ( | ) | const [protected, pure virtual] |
Implements storage::Container.
Implemented in storage::DmCo, storage::DmmultipathCo, storage::DmPartCo, storage::DmraidCo, and storage::LvmVg.
| bool storage::PeContainer::findPe | ( | const string & | dev, | |
| const list< Pv > & | pl, | |||
| list< Pv >::const_iterator & | i | |||
| ) | const [protected] |
References storage::Container::getStorage(), storage::Device::sameDevice(), y2mil, and y2war.
Referenced by addedPv(), addPv(), checkConsistency(), remLvPeDistribution(), and tryUnusePe().
| bool storage::PeContainer::findPe | ( | const string & | dev, | |
| list< Pv > & | pl, | |||
| list< Pv >::iterator & | i | |||
| ) | const [protected] |
References storage::Container::getStorage(), storage::Device::sameDevice(), y2mil, and y2war.
| unsigned long storage::PeContainer::leByLvRemove | ( | ) | const [protected] |
| int storage::PeContainer::tryUnusePe | ( | const string & | dev, | |
| std::list< Pv > & | pl, | |||
| std::list< Pv > & | pladd, | |||
| std::list< Pv > & | plrem, | |||
| unsigned long & | removed_pe | |||
| ) | [protected] |
References addLvPeDistribution(), storage::IterPair< Iter >::begin(), storage::Storage::clearUsedBy(), storage::PeContainer::Pv::device, dmPair(), storage::IterPair< Iter >::end(), findPe(), storage::Container::getStorage(), storage::Dm::notDeleted(), storage::PeContainer::Pv::num_pe, storage::PEC_PV_NOT_FOUND, storage::PEC_REMOVE_PV_IN_USE, storage::PEC_REMOVE_PV_SIZE_NEEDED, remLvPeDistribution(), and y2mil.
Referenced by storage::LvmVg::reduceVg().
| bool storage::PeContainer::checkCreateConstraints | ( | ) | [protected] |
References storage::IterPair< Iter >::begin(), dmPair(), storage::IterPair< Iter >::end(), num_pe, pe_size, pv, pv_add, pv_remove, remLvPeDistribution(), sizeToLe(), y2mil, and y2war.
Referenced by storage::LvmVg::doCreateVg(), and storage::LvmVg::doExtendVg().
| int storage::PeContainer::addLvPeDistribution | ( | unsigned long | le, | |
| unsigned | stripe, | |||
| std::list< Pv > & | pl, | |||
| std::list< Pv > & | pladd, | |||
| std::map< string, unsigned long > & | pe_map | |||
| ) | [static, protected] |
References storage::PeContainer::Pv::comp_le(), storage::PeContainer::Pv::no_free(), storage::PEC_LV_NO_SPACE_SINGLE, storage::PEC_LV_NO_SPACE_STRIPED, and y2mil.
Referenced by storage::LvmVg::changeStripe(), storage::LvmVg::createLv(), storage::LvmVg::createLvSnapshot(), storage::LvmVg::getVgData(), storage::LvmVg::resizeVolume(), and tryUnusePe().
| int storage::PeContainer::remLvPeDistribution | ( | unsigned long | le, | |
| std::map< string, unsigned long > & | pe_map, | |||
| std::list< Pv > & | pl, | |||
| std::list< Pv > & | pladd | |||
| ) | [protected] |
References findPe(), storage::PEC_LV_PE_DEV_NOT_FOUND, and y2mil.
Referenced by storage::LvmVg::changeStripe(), checkCreateConstraints(), storage::LvmVg::getVgData(), storage::LvmVg::removeLv(), storage::LvmVg::resizeVolume(), and tryUnusePe().
| bool storage::PeContainer::checkConsistency | ( | ) | const [protected, virtual] |
References storage::IterPair< Iter >::begin(), dmPair(), storage::IterPair< Iter >::end(), findPe(), free_pe, storage::Device::name(), storage::Dm::notDeleted(), num_pe, pv, pv_add, and y2war.
Referenced by storage::LvmVg::changeStripe(), storage::LvmVg::changeStripeSize(), storage::LvmVg::createLv(), storage::LvmVg::createLvSnapshot(), storage::Storage::detectLvmVgs(), storage::LvmVg::doCreate(), storage::LvmVg::doCreateVg(), storage::LvmVg::doExtendVg(), storage::LvmVg::doReduceVg(), storage::LvmVg::doRemove(), storage::LvmVg::doRemoveVg(), storage::LvmVg::doResize(), storage::LvmVg::extendVg(), storage::LvmVg::getLvSnapshotState(), storage::LvmVg::reduceVg(), storage::LvmVg::removeLv(), storage::Storage::rescanCryptedObjects(), and storage::LvmVg::resizeVolume().
| void storage::PeContainer::addPv | ( | const Pv & | p | ) | [protected] |
Reimplemented in storage::DmmultipathCo, and storage::DmraidCo.
References storage::PeContainer::Pv::device, storage::Storage::eraseLabelVolume(), findPe(), storage::Container::getStorage(), pv, pv_add, and pv_remove.
Referenced by storage::LvmVg::addPv(), storage::DmraidCo::addPv(), and storage::DmmultipathCo::addPv().
| PeContainer& storage::PeContainer::operator= | ( | const PeContainer & | ) | [private] |
friend class Storage [friend] |
Reimplemented from storage::Container.
Reimplemented in storage::DmCo, storage::DmmultipathCo, storage::DmPartCo, storage::DmraidCo, and storage::LvmVg.
| std::ostream& operator<< | ( | std::ostream & | s, | |
| const PeContainer & | d | |||
| ) | [friend] |
| std::ostream& operator<< | ( | std::ostream & | s, | |
| const Pv & | v | |||
| ) | [friend] |
| void printDevList | ( | std::ostream & | s, | |
| const std::list< Pv > & | l | |||
| ) | [friend] |
Referenced by storage::operator<<().
unsigned long long storage::PeContainer::pe_size [protected] |
Referenced by calcSize(), checkCreateConstraints(), storage::LvmVg::doCreateVg(), equalContent(), storage::LvmVg::extendVg(), storage::LvmVg::getVgData(), storage::DmPartCo::init(), logDifference(), storage::operator<<(), PeContainer(), peSize(), storage::LvmVg::resizeVolume(), storage::LvmVg::setPeSize(), and sizeToLe().
unsigned long storage::PeContainer::num_pe [protected] |
unsigned long storage::PeContainer::free_pe [protected] |
Referenced by storage::LvmVg::changeStripe(), checkConsistency(), storage::LvmVg::createLv(), storage::LvmVg::createLvSnapshot(), equalContent(), storage::LvmVg::extendVg(), storage::LvmVg::getVgData(), logDifference(), storage::operator<<(), PeContainer(), peFree(), storage::LvmVg::reduceVg(), storage::LvmVg::removeLv(), and storage::LvmVg::resizeVolume().
std::list<Pv> storage::PeContainer::pv [protected] |
Referenced by addPv(), storage::LvmVg::changeStripe(), checkConsistency(), checkCreateConstraints(), storage::LvmVg::createLv(), storage::LvmVg::createLvSnapshot(), storage::LvmVg::doCreateVg(), storage::DmraidCo::doRemove(), equalContent(), storage::LvmVg::extendVg(), storage::LvmVg::getInfo(), storage::DmPartCo::getInfo(), storage::DmmultipathCo::getMultipathData(), storage::DmraidCo::getRaidData(), getUsing(), storage::LvmVg::getVgData(), logDifference(), storage::LvmVg::normalizeDmDevices(), numPv(), storage::operator<<(), PeContainer(), storage::LvmVg::reduceVg(), storage::LvmVg::removeLv(), storage::LvmVg::resizeVolume(), saveData(), and unuseDev().
std::list<Pv> storage::PeContainer::pv_add [protected] |
Referenced by addedPv(), addList(), addPv(), changeDeviceName(), storage::LvmVg::changeStripe(), checkConsistency(), checkCreateConstraints(), storage::LvmVg::commitChanges(), storage::LvmVg::createLv(), storage::LvmVg::createLvSnapshot(), storage::LvmVg::doCreateVg(), storage::LvmVg::doExtendVg(), equalContent(), storage::LvmVg::extendVg(), storage::LvmVg::getCommitActions(), storage::LvmVg::getInfo(), storage::LvmVg::getToCommit(), getUsing(), storage::LvmVg::getVgData(), logDifference(), storage::operator<<(), storage::LvmVg::reduceVg(), storage::LvmVg::removeLv(), storage::LvmVg::resizeVolume(), and unuseDev().
std::list<Pv> storage::PeContainer::pv_remove [protected] |
Referenced by addPv(), storage::LvmVg::addPv(), checkCreateConstraints(), storage::LvmVg::commitChanges(), storage::LvmVg::doCreateVg(), storage::LvmVg::doReduceVg(), equalContent(), storage::LvmVg::extendVg(), storage::LvmVg::getCommitActions(), storage::LvmVg::getInfo(), storage::LvmVg::getToCommit(), getUsing(), logDifference(), storage::operator<<(), and storage::LvmVg::reduceVg().
1.5.6