[yast-commit] r63197 - in /trunk/storage: package/yast2-storage.changes storage/src/include/custom_part_dialogs.ycp storage/src/modules/FileSystems.ycp
![](https://seccdn.libravatar.org/avatar/bb376bca2c19e74eb46fa87c724f1105.jpg?s=120&d=mm&r=g)
Author: fehr Date: Tue Jan 18 12:11:36 2011 New Revision: 63197 URL: http://svn.opensuse.org/viewcvs/yast?rev=63197&view=rev Log: allow floating point value in reserved block percentage and set default to reserve about 1Gig, but <= 5.0% and >= 0.1% (bnc #661953) Modified: trunk/storage/package/yast2-storage.changes trunk/storage/storage/src/include/custom_part_dialogs.ycp trunk/storage/storage/src/modules/FileSystems.ycp Modified: trunk/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=63197&r1=63196&r2=63197&view=diff ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Tue Jan 18 12:11:36 2011 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Jan 17 17:28:51 CET 2011 - fehr@suse.de + +- allow floating point value in reserved block percentage and + set default to reserve about 1Gig, but <= 5.0% and >= 0.1% + (bnc #661953) + +------------------------------------------------------------------- Thu Dec 23 17:40:50 CET 2010 - fehr@suse.de - changes for improved btrfs support Modified: trunk/storage/storage/src/include/custom_part_dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/custom_part_dialogs.ycp?rev=63197&r1=63196&r2=63197&view=diff ============================================================================== --- trunk/storage/storage/src/include/custom_part_dialogs.ycp (original) +++ trunk/storage/storage/src/include/custom_part_dialogs.ycp Tue Jan 18 12:11:36 2011 @@ -266,6 +266,7 @@ ``{ symbol ret = `ok; list between = entry[`between]:[]; + integer below = entry[`below]:0; string valid_chars = entry[`valid_chars]:""; integer str_length = entry[`str_length]:0; @@ -279,7 +280,15 @@ ret = `error; } } - + if( below != 0 && (size(query)>0 || !entry[`empty_allowed]:false)) + { + y2milestone( "DoInputChecks entry:%1 query:\"%2\"", entry, query ); + if( below < tofloat(query) ) + { + Popup::Error(entry[`error_text]:""); + ret = `error; + } + } if( valid_chars != "" && size(query)>0 && ret != `error ) { if( nil != findfirstnotof( query, valid_chars )) Modified: trunk/storage/storage/src/modules/FileSystems.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/FileSystems.ycp?rev=63197&r1=63196&r2=63197&view=diff ============================================================================== --- trunk/storage/storage/src/modules/FileSystems.ycp (original) +++ trunk/storage/storage/src/modules/FileSystems.ycp Tue Jan 18 12:11:36 2011 @@ -550,14 +550,14 @@ `query_key : "opt_reserved_blocks", `option_str : "-m", //`default : 5, - `between : [ 0 , 99 ], // -> -1 = infinite - `str_length : 2, - `valid_chars : "0123456789", + `below : 99, + `str_length : 6, + `valid_chars : "0123456789.", // popup text - `error_text : _("The \"Percentage of blocks reserved for root\" value is incorrect.\nPlease use a value between 0 and 99."), + `error_text : _("The \"Percentage of blocks reserved for root\" value is incorrect.\nAllowed are float numbers not larger than 99. (e.g. 0.5)"), // xgettext: no-c-format // help text, richtext format - `help_text : _("<p><b>Percentage of blocks reserved for root:</b> Specify the percentage of blocks reserved for the super user. This value defaults to 5%.</p>") + `help_text : _("<p><b>Percentage of blocks reserved for root:</b> Specify the percentage of blocks reserved for the super user. The default is computed so that normally 1 Gig is reserved. Upper limit for reserved default is 5.0, lowest reserved default is 0.1.</p>") ], $[ // checkbox text @@ -1329,6 +1329,21 @@ ret["opt_blocksize"] = $[ "option_str" : "-b", "option_value" : "4096" ]; } + if( contains( [`ext2, `ext3, `ext4], fsys ) ) + { + if( Arch::s390() ) + { + ret["opt_blocksize"] = $[ "option_str" : "-b", + "option_value" : "4096" ]; + } + float f = (1048576.0 / (part["size_k"]:0)) * 100; + if( f > 5 ) + f = 5; + if( f < 0.1 ) + f = 0.1; + ret["opt_reserved_blocks"] = $[ "option_str" : "-m", + "option_value" : tostring( f, 1 ) ]; + } } y2milestone( "DefaultFormatOptions fsys %1 fmt %2 is %3", fsys, part["format"]:false, ret ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
fehr@svn2.opensuse.org