00001 /* 00002 * File: MdPart.h 00003 * 00004 * Declaration of MdPart class which represents single partition on MD 00005 * Device (RAID Volume). 00006 * 00007 * Copyright (c) 2009, Intel Corporation. 00008 * Copyright (c) 2009 Novell, Inc. 00009 * 00010 * This program is free software; you can redistribute it and/or modify it 00011 * under the terms and conditions of the GNU General Public License, 00012 * version 2, as published by the Free Software Foundation. 00013 * 00014 * This program is distributed in the hope it will be useful, but WITHOUT 00015 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00016 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00017 * more details. 00018 * 00019 * You should have received a copy of the GNU General Public License along with 00020 * this program; if not, write to the Free Software Foundation, Inc., 00021 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 00022 */ 00023 00024 #ifndef MD_PART_H 00025 #define MD_PART_H 00026 00027 #include "y2storage/Md.h" 00028 #include "y2storage/Partition.h" 00029 00030 namespace storage 00031 { 00032 00033 class MdPartCo; 00034 class ProcPart; 00035 00036 class MdPart : public Volume 00037 { 00038 public: 00039 MdPart( const MdPartCo& d, unsigned nr, Partition* p=NULL ); 00040 MdPart( const MdPartCo& d, const MdPart& rd ); 00041 MdPart& operator=( const MdPart& ); 00042 00043 virtual ~MdPart(); 00044 friend std::ostream& operator<< (std::ostream& s, const MdPart &p ); 00045 virtual void print( std::ostream& s ) const { s << *this; } 00046 void getInfo( storage::MdPartInfo& info ) const; 00047 void getPartitionInfo(storage::PartitionInfo& pinfo); 00048 bool equalContent( const MdPart& rhs ) const; 00049 void logDifference( const MdPart& d ) const; 00050 void setPtr( Partition* pa ) { p=pa; }; 00051 Partition* getPtr() const { return p; }; 00052 unsigned id() const { return p?p->id():0; } 00053 void updateName(); 00054 void updateMinor(); 00055 void updateSize( ProcPart& pp ); 00056 void updateSize(); 00057 void getCommitActions( std::list<storage::commitAction*>& l ) const; 00058 void addUdevData(); 00059 virtual const std::list<string> udevId() const; 00060 virtual string setTypeText( bool doing=true ) const; 00061 static bool notDeleted( const MdPart& l ) { return( !l.deleted() ); } 00062 00063 protected: 00064 void init( const string& name ); 00065 void dataFromPart( const Partition* p ); 00066 virtual const string shortPrintedName() const { return( "MdPart" ); } 00067 const MdPartCo* co() const; 00068 void addAltUdevId( unsigned num ); 00069 Partition* p; 00070 00071 mutable storage::MdPartInfo info; 00072 }; 00073 00074 } 00075 00076 #endif
1.5.6