[yast-commit] r56534 - in /trunk/storage/libstorage/src: Md.cc MdCo.cc
Author: aschnell Date: Wed Apr 1 14:25:10 2009 New Revision: 56534 URL: http://svn.opensuse.org/viewcvs/yast?rev=56534&view=rev Log: - even more improved used-by handling during detection Modified: trunk/storage/libstorage/src/Md.cc trunk/storage/libstorage/src/MdCo.cc Modified: trunk/storage/libstorage/src/Md.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Md.cc?rev=56534&r1=56533&r2=56534&view=diff ============================================================================== --- trunk/storage/libstorage/src/Md.cc (original) +++ trunk/storage/libstorage/src/Md.cc Wed Apr 1 14:25:10 2009 @@ -21,8 +21,8 @@ using namespace std; -Md::Md( const MdCo& d, unsigned PNr, MdType Type, - const list<string>& devices ) : Volume( d, PNr, 0 ) +Md::Md( const MdCo& d, unsigned PNr, MdType Type, const list<string>& devices ) + : Volume( d, PNr, 0 ) { y2deb("constructed md " << dev << " on container " << cont->name()); if( d.type() != MD ) @@ -34,6 +34,7 @@ computeSize(); } + Md::Md( const MdCo& d, const string& line1, const string& line2 ) : Volume( d, 0, 0 ) { @@ -46,6 +47,7 @@ nm.clear(); setNameDev(); getMajorMinor( dev, mjr, mnr ); + getContainer()->getStorage()->fetchDanglingUsedBy(dev, uby); } SystemCmd c(MDADMBIN " --detail " + quote(device())); c.select( "UUID : " ); @@ -160,8 +162,12 @@ break; } } + + for (list<string>::iterator it = devs.begin(); it != devs.end(); ++it) + getContainer()->getStorage()->setUsedBy(*it, UB_MD, dev.substr(5)); } + Md::~Md() { y2deb("destructed md " << dev); Modified: trunk/storage/libstorage/src/MdCo.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/MdCo.cc?rev=56534&r1=56533&r2=56534&view=diff ============================================================================== --- trunk/storage/libstorage/src/MdCo.cc (original) +++ trunk/storage/libstorage/src/MdCo.cc Wed Apr 1 14:25:10 2009 @@ -145,15 +145,6 @@ } getline( file, line ); } - MdPair p=mdPair(Md::notDeleted); - for( MdIter i=p.begin(); i!=p.end(); ++i ) - { - string num = "md"+decString(i->nr()); - list<string> devs; - i->getDevs( devs ); - for( list<string>::iterator s=devs.begin(); s!=devs.end(); ++s ) - getStorage()->setUsedBy( *s, UB_MD, num ); - } } void -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org