#include <EtcRaidtab.h>
Public Member Functions | |
| EtcRaidtab (const Storage *sto, const string &prefix="") | |
| ~EtcRaidtab () | |
| void | updateEntry (unsigned num, const std::list< string > &entries, const string &, const std::list< string > &devs) |
| void | removeEntry (unsigned num) |
| bool | updateEntry (const mdconf_info &info) |
| bool | removeEntry (const mdconf_info &into) |
Protected Types | |
| enum | lineType { DEVICE = 0, ARRAY, MAILFROM, PROGRAM, CREATE, HOMEHOST, AUTO, COMMENT, EMPTY, UNKNOWN } |
Protected Member Functions | |
| void | updateMdadmFile () |
| void | buildMdadmMap () |
| void | buildMdadmMap2 () |
| string | getUUID (const string &line) |
| lineType | getLineType (const string &line) |
| bool | getArrayLine (unsigned &line, string &uuid) |
| string | ContLine (const mdconf_info &info) |
| string | ArrayLine (const mdconf_info &info) |
| bool | updateContainer (const mdconf_info &info) |
| void | setDeviceLine (const string &line) |
| void | setAutoLine (const string &line) |
Protected Attributes | |
| const Storage * | sto |
| string | mdadmname |
| std::map< unsigned, entry > | mtab |
| std::map< string, entry > | uuidtab |
| AsciiFile * | mdadm |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const entry &v) |
Classes | |
| struct | entry |
| struct | mdconf_info |
enum storage::EtcRaidtab::lineType [protected] |
| EtcRaidtab::EtcRaidtab | ( | const Storage * | sto, | |
| const string & | prefix = "" | |||
| ) |
References buildMdadmMap(), buildMdadmMap2(), mdadm, and mdadmname.
| EtcRaidtab::~EtcRaidtab | ( | ) |
References mdadm.
| void EtcRaidtab::updateEntry | ( | unsigned | num, | |
| const std::list< string > & | entries, | |||
| const string & | mline, | |||
| const std::list< string > & | devs | |||
| ) |
| void EtcRaidtab::removeEntry | ( | unsigned | num | ) |
References mdadm, mtab, storage::AsciiFile::remove(), and updateMdadmFile().
Referenced by storage::MdPartCo::doRemove(), and storage::MdCo::doRemove().
| bool EtcRaidtab::updateEntry | ( | const mdconf_info & | info | ) |
References storage::AsciiFile::append(), ArrayLine(), storage::EtcRaidtab::mdconf_info::container_info, storage::EtcRaidtab::mdconf_info::container_present, storage::EtcRaidtab::mdconf_info::fs_name, storage::Storage::hasIScsiDisks(), storage::EtcRaidtab::mdconf_info::md_uuid, mdadm, storage::AsciiFile::replace(), setAutoLine(), setDeviceLine(), sto, updateContainer(), updateMdadmFile(), uuidtab, and y2mil.
| bool EtcRaidtab::removeEntry | ( | const mdconf_info & | into | ) |
| void EtcRaidtab::updateMdadmFile | ( | ) | [protected] |
References buildMdadmMap(), buildMdadmMap2(), storage::AsciiFile::loadFile(), mdadm, mdadmname, mtab, storage::AsciiFile::updateFile(), and uuidtab.
Referenced by removeEntry(), updateContainer(), and updateEntry().
| void EtcRaidtab::buildMdadmMap | ( | ) | [protected] |
References storage::extractNthWord(), storage::EtcRaidtab::entry::first, storage::EtcRaidtab::entry::last, mdadm, storage::Md::mdStringNum(), and mtab.
Referenced by EtcRaidtab(), and updateMdadmFile().
| void EtcRaidtab::buildMdadmMap2 | ( | ) | [protected] |
References ARRAY, storage::EtcRaidtab::entry::first, getArrayLine(), getLineType(), storage::EtcRaidtab::entry::last, mdadm, storage::AsciiFile::numLines(), and uuidtab.
Referenced by EtcRaidtab(), and updateMdadmFile().
| string EtcRaidtab::getUUID | ( | const string & | line | ) | [protected] |
Referenced by getArrayLine().
| EtcRaidtab::lineType EtcRaidtab::getLineType | ( | const string & | line | ) | [protected] |
References ARRAY, AUTO, COMMENT, CREATE, DEVICE, EMPTY, storage::extractNthWord(), HOMEHOST, MAILFROM, PROGRAM, and UNKNOWN.
Referenced by buildMdadmMap2(), and getArrayLine().
| bool EtcRaidtab::getArrayLine | ( | unsigned & | line, | |
| string & | uuid | |||
| ) | [protected] |
References ARRAY, AUTO, COMMENT, CREATE, DEVICE, EMPTY, getLineType(), getUUID(), HOMEHOST, MAILFROM, mdadm, storage::AsciiFile::numLines(), PROGRAM, and UNKNOWN.
Referenced by buildMdadmMap2().
| string EtcRaidtab::ContLine | ( | const mdconf_info & | info | ) | [protected] |
| string EtcRaidtab::ArrayLine | ( | const mdconf_info & | info | ) | [protected] |
| bool EtcRaidtab::updateContainer | ( | const mdconf_info & | info | ) | [protected] |
References storage::AsciiFile::append(), storage::EtcRaidtab::mdconf_info::container_info, ContLine(), storage::AsciiFile::insert(), storage::EtcRaidtab::mdconf_info::md_uuid, mdadm, storage::AsciiFile::remove(), storage::AsciiFile::replace(), updateMdadmFile(), and uuidtab.
Referenced by updateEntry().
| void EtcRaidtab::setDeviceLine | ( | const string & | line | ) | [protected] |
References storage::AsciiFile::find(), storage::AsciiFile::insert(), mdadm, and storage::AsciiFile::replace().
Referenced by updateEntry().
| void EtcRaidtab::setAutoLine | ( | const string & | line | ) | [protected] |
References storage::AsciiFile::find(), storage::AsciiFile::insert(), mdadm, and storage::AsciiFile::replace().
Referenced by updateEntry().
| std::ostream& operator<< | ( | std::ostream & | s, | |
| const entry & | v | |||
| ) | [friend] |
const Storage* storage::EtcRaidtab::sto [protected] |
Referenced by updateEntry().
string storage::EtcRaidtab::mdadmname [protected] |
Referenced by EtcRaidtab(), and updateMdadmFile().
std::map<unsigned,entry> storage::EtcRaidtab::mtab [protected] |
Referenced by buildMdadmMap(), removeEntry(), updateEntry(), and updateMdadmFile().
std::map<string,entry> storage::EtcRaidtab::uuidtab [protected] |
Referenced by buildMdadmMap2(), removeEntry(), updateContainer(), updateEntry(), and updateMdadmFile().
AsciiFile* storage::EtcRaidtab::mdadm [protected] |
1.5.6