Author: fehr
Date: Thu May 26 16:08:44 2011
New Revision: 64116
URL: http://svn.opensuse.org/viewcvs/yast?rev=64116&view=rev
Log:
- remove unsupported state of btrfs
- more btrfs related bugfixes
- version 2.17.103
Modified:
branches/SuSE-Code-11-SP2-Branch/storage/VERSION
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc
branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/FileSystems.ycp
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp
Modified: branches/SuSE-Code-11-SP2-Branch/storage/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/VERSION?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/VERSION (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/VERSION Thu May 26 16:08:44 2011
@@ -1 +1 @@
-2.17.102
+2.17.103
Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc Thu May 26 16:08:44 2011
@@ -536,6 +536,53 @@
return( txt );
}
+Text Btrfs::formatText(bool doing) const
+ {
+ Text txt;
+ bool done = false;
+ if( devices.size()+dev_add.size()==1 )
+ {
+ Volume const *v = NULL;
+ if( getStorage()->findVolume( devices.front(), v, true ))
+ {
+ y2mil( "found:" << *v );
+ txt = v->formatText(doing);
+ done = true;
+ }
+ }
+ if( !done )
+ {
+ list<string> tl = devices;
+ tl.insert( tl.end(), dev_add.begin(), dev_add.end() );
+ string d = boost::join( tl, " " );
+ if( doing )
+ {
+ // displayed text during action,
+ // %1$s is replaced by size (e.g. 623.5 MB)
+ // %2$s is repleace by a list of names e.g /dev/sda1 /dev/sda2
+ txt = sformat( _("Formatting Btrfs volume of size %1$s (used devices:%2$s)"),
+ sizeString().c_str(), d.c_str() );
+ }
+ else
+ {
+ if( !mp.empty() )
+ // displayed text before action,
+ // %1$s is replaced by size (e.g. 623.5 MB)
+ // %2$s is repleace by a list of names e.g /dev/sda1 /dev/sda2
+ // %3$s is replaced by mount point (e.g. /usr)
+ txt = sformat( _("Format Btrfs volume of size %1$s for %3$s (used devices:%2$s)"),
+ sizeString().c_str(), d.c_str(), mp.c_str() );
+ else
+ // displayed text before action,
+ // %1$s is replaced by size (e.g. 623.5 MB)
+ // %2$s is repleace by a list of names e.g /dev/sda1 /dev/sda2
+ txt = sformat( _("Format Btrfs volume of size %1$s (used devices:%2$s)"),
+ sizeString().c_str(), d.c_str() );
+ }
+ }
+ return( txt );
+ }
+
void
Btrfs::getCommitActions(list<commitAction>& l) const
{
Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h Thu May 26 16:08:44 2011
@@ -65,6 +65,7 @@
Text extendText(bool doing, const string& device) const;
Text reduceText(bool doing, const string& device) const;
Text removeText( bool doing ) const;
+ Text formatText( bool doing ) const;
void countSubvolAddDel( unsigned& add, unsigned& rem ) const;
list<string> getSubvolAddDel( bool ) const;
Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc Thu May 26 16:08:44 2011
@@ -305,20 +305,28 @@
int BtrfsCo::commitChanges( CommitStage stage, Volume* vol )
{
y2mil("name:" << name() << " stage:" << stage);
- int ret = Container::commitChanges( stage, vol );
- if( ret==0 && stage==DECREASE )
+ int ret = 0;
+ if( stage==DECREASE )
{
Btrfs * b = dynamic_cast(vol);
if( b!=NULL )
- ret = b->doReduce();
+ {
+ if( Btrfs::needReduce(*b) )
+ ret = b->doReduce();
+ }
else
ret = BTRFS_COMMIT_INVALID_VOLUME;
}
- else if( ret==0 && stage==INCREASE )
+ if( ret==0 )
+ ret = Container::commitChanges( stage, vol );
+ if( ret==0 && stage==INCREASE )
{
Btrfs * b = dynamic_cast(vol);
if( b!=NULL )
- ret = b->doExtend();
+ {
+ if( Btrfs::needExtend(*b) )
+ ret = b->doExtend();
+ }
else
ret = BTRFS_COMMIT_INVALID_VOLUME;
}
Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc Thu May 26 16:08:44 2011
@@ -3145,7 +3145,7 @@
{
ret = STORAGE_CHANGE_READONLY;
}
- else if( findVolume( device, cont, vol, false ) )
+ else if( findVolume( device, cont, vol, true ) )
{
if( canRemove( *vol ) )
{
Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc Thu May 26 16:08:44 2011
@@ -1089,7 +1089,7 @@
int ret = -1;
if( fs!=TMPFS )
{
- int ret = cmd.execute( cmdline );
+ ret = cmd.execute( cmdline );
if( ret != 0 && mountDevice()!=dev )
{
cmdline = ((detected_fs != SWAP)?UMOUNTBIN " ":SWAPOFFBIN " ") + quote(dev);
Modified: branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Thu May 26 16:08:44 2011
@@ -1,7 +1,10 @@
-------------------------------------------------------------------
-Thu May 26 13:59:15 CEST 2011 - fehr@suse.de
+Thu May 26 16:07:46 CEST 2011 - fehr@suse.de
- backport patch to support also parted 2.4
+- remove unsupported state of btrfs
+- more btrfs related bugfixes
+- version 2.17.103
-------------------------------------------------------------------
Tue May 24 11:24:24 CEST 2011 - fehr@suse.de
Modified: branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/FileSystems.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/FileSystems.ycp?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/FileSystems.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/FileSystems.ycp Thu May 26 16:08:44 2011
@@ -182,7 +182,7 @@
`lvm : true
];
- list<symbol> unsupportFs = [ `jfs, `btrfs ];
+ list<symbol> unsupportFs = [ `jfs ];
global define list