Author: fehr
Date: Tue Jul 20 11:33:39 2010
New Revision: 62277
URL: http://svn.opensuse.org/viewcvs/yast?rev=62277&view=rev
Log:
add support for additional parity values for raid5, raid6, raid10
Modified:
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/include/ep-raid-dialogs.ycp
trunk/storage/storage/src/include/ep-raid-lib.ycp
trunk/storage/storage/src/modules/Storage.ycp
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=62277&r1=62276&r2=62277&view=diff
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Tue Jul 20 11:33:39 2010
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Tue Jul 20 11:26:30 CEST 2010 - fehr@suse.de
+
+- add support for additional parity values for raid5, raid6, raid10
+
+-------------------------------------------------------------------
Wed Jul 14 10:12:46 CEST 2010 - aschnell@suse.de
- improved help text (bnc #506814)
Modified: trunk/storage/storage/src/include/ep-raid-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-raid-dialogs.ycp?rev=62277&r1=62276&r2=62277&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-raid-dialogs.ycp (original)
+++ trunk/storage/storage/src/include/ep-raid-dialogs.ycp Tue Jul 20 11:33:39 2010
@@ -206,15 +206,23 @@
32 kB is a good starting point. For RAID 1, the chunk size does not affect the array very much.</p>
");
- if (raid_type == "raid5")
+ if (raid_type == "raid5" || raid_type == "raid6")
// helptext
- helptext = helptext + _("<p><b>Parity Algorithm:</b><br>The parity algorithm to use with RAID5.
+ helptext = helptext + _("<p><b>Parity Algorithm:</b><br>The parity algorithm to use with RAID5/6.
Left-symmetric is the one that offers maximum performance on typical disks with rotating platters.</p>
");
return helptext;
}
+ list<term> getParTerms( string mdtype, integer sz )
+ {
+ list<list> pars = Storage::AllowdParity( mdtype, sz );
+ return( maplist( list e, pars,
+ ``{
+ return( `item( `id(e[0]:`par_default), e[1]:"" ));
+ }));
+ }
symbol MiniWorkflowStepRaidOptions(map &data)
{
@@ -222,7 +230,7 @@
string raid_type = data["raid_type"]:"error";
integer chunk_size = (data["chunk_size_k"]:DefaultChunkSizeK(raid_type))*1024;
- symbol parity_algorithm = data["parity_algorithm"]:`left_asymmetric;
+ symbol parity_algorithm = data["parity_algorithm"]:`par_default;
list<term> chunk_sizes_list = maplist(integer i, Integer::RangeFrom(11, 22), {
return `item(`id(2 << i), Storage::ByteToHumanStringOmitZeroes(2 << i));
@@ -233,15 +241,14 @@
`id(chunk_size)))
);
- if (raid_type == "raid5")
+ list<term> par_list = getParTerms( raid_type, size(data["devices"]:[]));
+
+ if (size(par_list)>0)
options = add(options,
`Left(`ComboBoxSelected(`id(`parity_algorithm), `opt(`hstretch),
// combo box label
_("Parity &Algorithm"),
- [ `item(`id(`left_asymmetric), "left-asymmetric"),
- `item(`id(`left_symmetric), "left-symmetric"),
- `item(`id(`right_asymmetric), "right-asymmetric"),
- `item(`id(`right_symmetric), "right-symmetric") ],
+ par_list,
`id(parity_algorithm)))
);
Modified: trunk/storage/storage/src/include/ep-raid-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-raid-lib.ycp?rev=62277&r1=62276&r2=62277&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-raid-lib.ycp (original)
+++ trunk/storage/storage/src/include/ep-raid-lib.ycp Tue Jul 20 11:33:39 2010
@@ -71,10 +71,11 @@
integer chunk_size_k = data["chunk_size_k"]:4;
Storage::ChangeMdChunk(nr, chunk_size_k);
- if (raid_type == `raid5) {
- symbol parity_algorithm = data["parity_algorithm"]:`left_asymmetric;
+ if( haskey( data, "parity_algorithm" ))
+ {
+ symbol parity_algorithm = data["parity_algorithm"]:`par_default;
Storage::ChangeMdParitySymbol(nr, parity_algorithm);
- }
+ }
Storage::ChangeVolumeProperties(data);
Modified: trunk/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=62277&r1=62276&r2=62277&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/Storage.ycp (original)
+++ trunk/storage/storage/src/modules/Storage.ycp Tue Jul 20 11:33:39 2010
@@ -163,20 +163,51 @@
"multipath" : LibStorage::MULTIPATH() ];
map conv_mdparity =
- $[ "def_sym" : `par_none,
- "def_int" : LibStorage::PAR_NONE(),
+ $[ "def_sym" : `par_default,
+ "def_int" : LibStorage::PAR_DEFAULT(),
"m" : $[ LibStorage::LEFT_ASYMMETRIC() : `left_asymmetric,
LibStorage::LEFT_SYMMETRIC() : `left_symmetric,
LibStorage::RIGHT_ASYMMETRIC() : `right_asymmetric,
- LibStorage::RIGHT_SYMMETRIC() : `right_symmetric
+ LibStorage::RIGHT_SYMMETRIC() : `right_symmetric,
+ LibStorage::PAR_FIRST() : `par_first,
+ LibStorage::PAR_LAST() : `par_last,
+ LibStorage::LEFT_ASYMMETRIC_6() : `left_asymmetric_6,
+ LibStorage::LEFT_SYMMETRIC_6() : `left_symmetric_6,
+ LibStorage::RIGHT_ASYMMETRIC_6() : `right_asymmetric_6,
+ LibStorage::RIGHT_SYMMETRIC_6() : `right_symmetric_6,
+ LibStorage::PAR_FIRST_6() : `par_first_6,
+ LibStorage::PAR_NEAR_2() : `par_near_2,
+ LibStorage::PAR_OFFSET_2() : `par_offset_2,
+ LibStorage::PAR_FAR_2() : `par_far_2,
+ LibStorage::PAR_NEAR_3() : `par_near_3,
+ LibStorage::PAR_OFFSET_3() : `par_offset_3,
+ LibStorage::PAR_FAR_3() : `par_far_3
]
];
map conv_parstring =
- $[ "left_asymmetric" : LibStorage::LEFT_ASYMMETRIC(),
+ $[ "default" : LibStorage::PAR_DEFAULT(),
+ "left_asymmetric" : LibStorage::LEFT_ASYMMETRIC(),
"left_symmetric" : LibStorage::LEFT_SYMMETRIC(),
"right_asymmetric" : LibStorage::RIGHT_ASYMMETRIC(),
- "right_symmetric" : LibStorage::RIGHT_SYMMETRIC() ];
+ "right_symmetric" : LibStorage::RIGHT_SYMMETRIC(),
+ "parity_first" : LibStorage::PAR_FIRST(),
+ "parity_last" : LibStorage::PAR_LAST(),
+ "left_asymmetric_6" : LibStorage::LEFT_ASYMMETRIC_6(),
+ "left_symmetric_6" : LibStorage::LEFT_SYMMETRIC_6(),
+ "right_asymmetric_6" : LibStorage::RIGHT_ASYMMETRIC_6(),
+ "right_symmetric_6" : LibStorage::RIGHT_SYMMETRIC_6(),
+ "parity_first_6" : LibStorage::PAR_FIRST_6(),
+ "n2" : LibStorage::PAR_NEAR_2(),
+ "o2" : LibStorage::PAR_OFFSET_2(),
+ "f2" : LibStorage::PAR_FAR_2(),
+ "n3" : LibStorage::PAR_NEAR_3(),
+ "o3" : LibStorage::PAR_OFFSET_3(),
+ "f3" : LibStorage::PAR_FAR_3()
+ ];
+
+map rev_conv_parstring =
+ mapmap( string s, integer i, conv_parstring, {return$[ i: s ];});
map conv_partalign =
$[ "def_sym" : `align_optimal,
@@ -5665,4 +5696,16 @@
return ret;
}
+global list<list> AllowdParity( string mdtype, integer sz )
+ {
+ integer mdt = conv_mdstring[mdtype]:0;
+ list<integer> pars =
+ LibStorage::StorageInterface::getMdAllowedParity(sint, mdt, sz );
+ list<list> ret = maplist( integer i, pars,
+ {return( [ toSymbol(conv_mdparity, i),
+ rev_conv_parstring[i]:"" ] );});
+ y2milestone( "ret:%1", ret );
+ return( ret );
+ }
+
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org