storage::MdPartCo Class Reference

#include <MdPartCo.h>

Inheritance diagram for storage::MdPartCo:

storage::Container storage::Device

List of all members.

Public Member Functions

 MdPartCo (Storage *s, const string &name, const string &device, SystemInfo &systeminfo)
 MdPartCo (const MdPartCo &c)
virtual ~MdPartCo ()
const string & labelName () const
virtual list< string > udevId () const
unsigned numPartitions () const
void setUdevData (SystemInfo &systeminfo)
virtual string procName () const
virtual string sysfsPath () const
int getMdPartCoState (MdPartCoStateInfo &info) const
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, const Region &cylRegion, bool checkRelaxed=false)
int nextFreePartition (storage::PartitionType type, unsigned &nr, string &device) const
int destroyPartitionTable (const string &new_label)
int freeCylindersAroundPartition (const MdPart *p, unsigned long &freeCylsBefore, unsigned long &freeCylsAfter) 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
string getPartDevice (unsigned nr) const
virtual void getCommitActions (list< commitAction > &l) const
virtual void getToCommit (CommitStage stage, list< const Container * > &col, list< const Volume * > &vol) const
virtual int commitChanges (storage::CommitStage stage)
int commitChanges (storage::CommitStage stage, Volume *vol)
PartitiongetPartition (unsigned nr, bool del)
virtual list< string > getUsing () const
void getInfo (storage::MdPartCoInfo &info) const
bool equalContent (const Container &rhs) const
void logDifference (std::ostream &log, const MdPartCo &rhs) const
virtual void logDifferenceWithVolumes (std::ostream &log, const Container &rhs) const
MdPartCooperator= (const MdPartCo &rhs)
void syncMdadm (EtcMdadm *mdadm) const
unsigned nr () const
unsigned long chunkSizeK () const
storage::MdType personality () const
const string & getMdUuid () const
list< string > getDevs (bool all=true, bool spare=false) const

Static Public Member Functions

static storage::CType staticType ()
static bool notDeleted (const MdPartCo &c)
static string undevName (const string &name)
static list< string > getMdRaids (SystemInfo &systeminfo)
static void activate (bool val, const string &tmpDir)
static bool isActive ()
static bool hasPartitionTable (const string &name, SystemInfo &systeminfo)
static bool hasFileSystem (const string &name, SystemInfo &systeminfo)
static bool matchRegex (const string &dev)
static bool mdStringNum (const string &name, unsigned &num)
static bool scanForRaid (list< string > &raidNames)
static list< string > filterMdPartCo (const list< string > &raidList, SystemInfo &systeminfo, bool instsys)

Protected Types

typedef CastIterator< VIter,
MdPart * > 
MdPartInter
typedef CastIterator< CVIter,
const MdPart * > 
MdPartCInter
typedef CheckFnc< const MdPartCheckFncMdPart
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< MdPartIterMdPartPair
typedef IterPair< ConstMdPartIterConstMdPartPair

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
virtual void print (std::ostream &s) const
virtual ContainergetCopy () const
void activate_part (bool val)
void init (SystemInfo &systeminfo)
void createDisk (SystemInfo &systeminfo)
void getVolumes (const ProcParts &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)
bool updateEntry (EtcMdadm *mdadm) const
int doCreate (Volume *v)
int doRemove (Volume *v)
int doResize (Volume *v)
int doSetType (MdPart *v)
int doCreateLabel ()
virtual int doRemove ()
virtual Text removeText (bool doing) const
virtual Text setDiskLabelText (bool doing) const
void initMd (SystemInfo &systeminfo)
void setSize (unsigned long long size)
bool isMdPart (const string &name) const
void getPartNum (const string &device, unsigned &num) const
void unuseDevs () const

Static Protected Member Functions

static CType envSelection (const string &name)
static bool havePartsInProc (const string &name, SystemInfo &systeminfo)

Protected Attributes

Diskdisk
MdType md_type
MdParity md_parity
unsigned long chunk_k
string md_uuid
string md_name
string sb_ver
bool destrSb
list< string > devs
list< string > spare
list< string > udev_id
bool has_container
string parent_container
string parent_uuid
string parent_md_name
string parent_metadata
string parent_member
storage::MdPartCoInfo info

Static Protected Attributes

static bool active = false

Friends

class Storage
class Md
std::ostream & operator<< (std::ostream &, const MdPartCo &)

Classes

struct  MdPartCPI
struct  MdPartPI


Detailed Description

Class: MdPartCo

Brief: MD RAID Volume that can be partitioned and used as container for partitions.


Member Typedef Documentation


Constructor & Destructor Documentation

storage::MdPartCo::MdPartCo ( Storage s,
const string &  name,
const string &  device,
SystemInfo systeminfo 
)

storage::MdPartCo::MdPartCo ( const MdPartCo c  ) 

storage::MdPartCo::~MdPartCo (  )  [virtual]

References storage::Device::dev, disk, and y2deb.


Member Function Documentation

const string& storage::MdPartCo::labelName (  )  const [inline]

References disk, and storage::Disk::labelName().

Referenced by doCreateLabel().

virtual list<string> storage::MdPartCo::udevId (  )  const [inline, virtual]

Reimplemented from storage::Device.

References udev_id.

Referenced by storage::MdPart::addAltUdevId(), and storage::MdPart::udevId().

unsigned storage::MdPartCo::numPartitions (  )  const [inline]

static storage::CType storage::MdPartCo::staticType (  )  [inline, static]

Reimplemented from storage::Container.

References storage::MDPART.

Referenced by getCommitActions().

void storage::MdPartCo::setUdevData ( SystemInfo systeminfo  ) 

virtual string storage::MdPartCo::procName (  )  const [inline, virtual]

Reimplemented from storage::Device.

References storage::Device::nm.

Referenced by init(), and sysfsPath().

string storage::MdPartCo::sysfsPath (  )  const [virtual]

Reimplemented from storage::Device.

References procName(), and SYSFSDIR.

Referenced by getMdPartCoState(), and storage::MdPart::sysfsPath().

static bool storage::MdPartCo::notDeleted ( const MdPartCo c  )  [inline, static]

int storage::MdPartCo::getMdPartCoState ( MdPartCoStateInfo info  )  const

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 
)

int storage::MdPartCo::forgetChangePartitionId ( unsigned  nr  ) 

int storage::MdPartCo::changePartitionArea ( unsigned  nr,
const Region cylRegion,
bool  checkRelaxed = false 
)

int storage::MdPartCo::nextFreePartition ( storage::PartitionType  type,
unsigned &  nr,
string &  device 
) const

int storage::MdPartCo::destroyPartitionTable ( const string &  new_label  ) 

int storage::MdPartCo::freeCylindersAroundPartition ( const MdPart p,
unsigned long &  freeCylsBefore,
unsigned long &  freeCylsAfter 
) const

int storage::MdPartCo::resizePartition ( MdPart p,
unsigned long  newCyl 
)

int storage::MdPartCo::resizeVolume ( Volume v,
unsigned long long  newSize 
) [virtual]

int storage::MdPartCo::removeVolume ( Volume v  )  [virtual]

int storage::MdPartCo::removeMdPart (  ) 

unsigned storage::MdPartCo::maxPrimary (  )  const [inline]

bool storage::MdPartCo::extendedPossible (  )  const [inline]

unsigned storage::MdPartCo::maxLogical (  )  const [inline]

unsigned int storage::MdPartCo::numPrimary (  )  const [inline]

bool storage::MdPartCo::hasExtended (  )  const [inline]

unsigned int storage::MdPartCo::numLogical (  )  const [inline]

void storage::MdPartCo::getUnusedSpace ( std::list< Region > &  free,
bool  all = true,
bool  logical = false 
) const [inline]

unsigned long long storage::MdPartCo::cylinderToKb ( unsigned long  val  )  const [inline]

unsigned long storage::MdPartCo::kbToCylinder ( unsigned long long  val  )  const [inline]

string storage::MdPartCo::getPartName ( unsigned  nr  )  const

References storage::decString(), and storage::Device::nm.

Referenced by newP().

string storage::MdPartCo::getPartDevice ( unsigned  nr  )  const

void storage::MdPartCo::getCommitActions ( list< commitAction > &  l  )  const [virtual]

void storage::MdPartCo::getToCommit ( CommitStage  stage,
list< const Container * > &  col,
list< const Volume * > &  vol 
) const [virtual]

int storage::MdPartCo::commitChanges ( storage::CommitStage  stage  )  [virtual]

int storage::MdPartCo::commitChanges ( storage::CommitStage  stage,
Volume vol 
) [virtual]

Partition * storage::MdPartCo::getPartition ( unsigned  nr,
bool  del 
)

list< string > storage::MdPartCo::getUsing (  )  const [virtual]

Reimplemented from storage::Device.

References devs, and spare.

void storage::MdPartCo::getInfo ( storage::MdPartCoInfo info  )  const

bool storage::MdPartCo::equalContent ( const Container rhs  )  const [virtual]

void storage::MdPartCo::logDifference ( std::ostream &  log,
const MdPartCo rhs 
) const

void storage::MdPartCo::logDifferenceWithVolumes ( std::ostream &  log,
const Container rhs 
) const [virtual]

MdPartCo& storage::MdPartCo::operator= ( const MdPartCo rhs  ) 

string storage::MdPartCo::undevName ( const string &  name  )  [static]

list< string > storage::MdPartCo::getMdRaids ( SystemInfo systeminfo  )  [static]

void storage::MdPartCo::syncMdadm ( EtcMdadm mdadm  )  const

References updateEntry().

unsigned storage::MdPartCo::nr (  )  const [inline]

References storage::Device::mnr.

unsigned long storage::MdPartCo::chunkSizeK (  )  const [inline]

References chunk_k.

storage::MdType storage::MdPartCo::personality (  )  const [inline]

References md_type.

const string& storage::MdPartCo::getMdUuid (  )  const [inline]

References md_uuid.

Referenced by doRemove().

list< string > storage::MdPartCo::getDevs ( bool  all = true,
bool  spare = false 
) const

References devs, and spare.

Referenced by doRemove(), and unuseDevs().

void storage::MdPartCo::activate ( bool  val,
const string &  tmpDir 
) [static]

static bool storage::MdPartCo::isActive (  )  [inline, static]

References active.

bool storage::MdPartCo::hasPartitionTable ( const string &  name,
SystemInfo systeminfo 
) [static]

bool storage::MdPartCo::hasFileSystem ( const string &  name,
SystemInfo systeminfo 
) [static]

bool storage::MdPartCo::matchRegex ( const string &  dev  )  [static]

References storage::Regex::match().

Referenced by mdStringNum().

bool storage::MdPartCo::mdStringNum ( const string &  name,
unsigned &  num 
) [static]

bool storage::MdPartCo::scanForRaid ( list< string > &  raidNames  )  [static]

list< string > storage::MdPartCo::filterMdPartCo ( const list< string > &  raidList,
SystemInfo systeminfo,
bool  instsys 
) [static]

MdPartPair storage::MdPartCo::mdpartPair ( bool(*)(const MdPart &)  CheckMdPart = NULL  )  [inline, protected]

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]

ConstMdPartIter storage::MdPartCo::mdpartEnd ( bool(*)(const MdPart &)  CheckMdPart = NULL  )  const [inline, protected]

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]

Implements storage::Container.

References MdPartCo().

void storage::MdPartCo::activate_part ( bool  val  )  [protected]

Referenced by doCreate(), and doResize().

void storage::MdPartCo::init ( SystemInfo systeminfo  )  [protected]

void storage::MdPartCo::createDisk ( SystemInfo systeminfo  )  [protected]

void storage::MdPartCo::getVolumes ( const ProcParts ppart  )  [protected]

void storage::MdPartCo::updatePointers ( bool  invalid = false  )  [protected]

void storage::MdPartCo::updateMinor (  )  [protected]

void storage::MdPartCo::newP ( MdPart *&  dm,
unsigned  num,
Partition p 
) [protected, virtual]

int storage::MdPartCo::addNewDev ( string &  device  )  [protected]

int storage::MdPartCo::updateDelDev (  )  [protected]

void storage::MdPartCo::handleWholeDevice (  )  [protected]

void storage::MdPartCo::removeFromMemory (  )  [protected]

References storage::Container::vols, and y2mil.

Referenced by doCreateLabel().

void storage::MdPartCo::removePresentPartitions (  )  [protected]

bool storage::MdPartCo::validPartition ( const Partition p  )  [protected]

bool storage::MdPartCo::findMdPart ( unsigned  nr,
MdPartIter i 
) [protected]

bool storage::MdPartCo::updateEntry ( EtcMdadm mdadm  )  const [protected]

int storage::MdPartCo::doCreate ( Volume v  )  [protected, virtual]

int storage::MdPartCo::doRemove ( Volume v  )  [protected, virtual]

int storage::MdPartCo::doResize ( Volume v  )  [protected, virtual]

int storage::MdPartCo::doSetType ( MdPart v  )  [protected]

int storage::MdPartCo::doCreateLabel (  )  [protected]

int storage::MdPartCo::doRemove (  )  [protected, virtual]

Text storage::MdPartCo::removeText ( bool  doing  )  const [protected, virtual]

Text storage::MdPartCo::setDiskLabelText ( bool  doing  )  const [protected, virtual]

void storage::MdPartCo::initMd ( SystemInfo systeminfo  )  [protected]

void storage::MdPartCo::setSize ( unsigned long long  size  )  [protected]

References storage::Device::size_k.

Referenced by initMd().

bool storage::MdPartCo::isMdPart ( const string &  name  )  const [protected]

References storage::Regex::match(), and undevName().

Referenced by addNewDev().

void storage::MdPartCo::getPartNum ( const string &  device,
unsigned &  num 
) const [protected]

References storage::Device::dev.

Referenced by addNewDev().

void storage::MdPartCo::unuseDevs (  )  const [protected]

CType storage::MdPartCo::envSelection ( const string &  name  )  [static, protected]

bool storage::MdPartCo::havePartsInProc ( const string &  name,
SystemInfo systeminfo 
) [static, protected]


Friends And Related Function Documentation

friend class Storage [friend]

Reimplemented from storage::Container.

friend class Md [friend]

std::ostream& operator<< ( std::ostream &  s,
const MdPartCo d 
) [friend]


Member Data Documentation

unsigned long storage::MdPartCo::chunk_k [protected]

string storage::MdPartCo::md_uuid [protected]

string storage::MdPartCo::md_name [protected]

string storage::MdPartCo::sb_ver [protected]

bool storage::MdPartCo::destrSb [protected]

list<string> storage::MdPartCo::devs [protected]

list<string> storage::MdPartCo::spare [protected]

list<string> storage::MdPartCo::udev_id [protected]

Referenced by setUdevData(), and udevId().

Referenced by equalContent(), initMd(), and updateEntry().

Referenced by equalContent(), initMd(), and logDifference().

string storage::MdPartCo::parent_uuid [protected]

Referenced by equalContent(), initMd(), and logDifference().

Referenced by initMd(), and updateEntry().

Reimplemented from storage::Container.

Referenced by getInfo(), and updateEntry().

bool storage::MdPartCo::active = false [static, protected]


The documentation for this class was generated from the following files:

Generated on Mon Feb 6 10:42:58 2012 for yast2-storage by  doxygen 1.5.6