Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r55041 - in /branches/SuSE-Code-11-Branch/bootloader: VERSION package/yast2-bootloader.changes src/modules/BootCommon.ycp src/routines/misc.ycp
  • From: juhliarik@xxxxxxxxxxxxxxxx
  • Date: Mon, 26 Jan 2009 15:55:07 -0000
  • Message-id: <E1LRTnn-0002cy-PH@xxxxxxxxxxxxxxxx>
Author: juhliarik
Date: Mon Jan 26 16:55:07 2009
New Revision: 55041

URL: http://svn.opensuse.org/viewcvs/yast?rev=55041&view=rev
Log:
update function Dev2MountByDev() which tooks a log time for running on
machine with a huge number of disk

Modified:
branches/SuSE-Code-11-Branch/bootloader/VERSION
branches/SuSE-Code-11-Branch/bootloader/package/yast2-bootloader.changes
branches/SuSE-Code-11-Branch/bootloader/src/modules/BootCommon.ycp
branches/SuSE-Code-11-Branch/bootloader/src/routines/misc.ycp

Modified: branches/SuSE-Code-11-Branch/bootloader/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/bootloader/VERSION?rev=55041&r1=55040&r2=55041&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/bootloader/VERSION (original)
+++ branches/SuSE-Code-11-Branch/bootloader/VERSION Mon Jan 26 16:55:07 2009
@@ -1 +1 @@
-2.17.50
+2.17.51

Modified:
branches/SuSE-Code-11-Branch/bootloader/package/yast2-bootloader.changes
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/bootloader/package/yast2-bootloader.changes?rev=55041&r1=55040&r2=55041&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/bootloader/package/yast2-bootloader.changes
(original)
+++ branches/SuSE-Code-11-Branch/bootloader/package/yast2-bootloader.changes
Mon Jan 26 16:55:07 2009
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Jan 26 16:04:48 CET 2009 - juhliarik@xxxxxxx
+
+- updated function Dev2MountByDev() which can run long time if
+ machine included huge number of disks (bnc #468922)
+- 2.17.51
+
+-------------------------------------------------------------------
Tue Jan 20 14:13:48 CET 2009 - juhliarik@xxxxxxx

- added fix for problem with calling parted each time of running

Modified: branches/SuSE-Code-11-Branch/bootloader/src/modules/BootCommon.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/bootloader/src/modules/BootCommon.ycp?rev=55041&r1=55040&r2=55041&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/bootloader/src/modules/BootCommon.ycp
(original)
+++ branches/SuSE-Code-11-Branch/bootloader/src/modules/BootCommon.ycp Mon Jan
26 16:55:07 2009
@@ -81,6 +81,14 @@
global integer cached_settings_base_data_change_time = nil;

/**
+ * Saved change time from target map - only for MapAllPartitions()
+ */
+
+global integer saved_last_change_time_from_storage = nil;
+
+
+
+/**
* device mapping between Linux and firmware
*/
global map<string,string> device_mapping = $[];
@@ -371,6 +379,20 @@



+/**
+ * bnc #468922 - problem with longtime running the parsing a huge number of
disks
+ * map<string,map> the map of all partitions with info about it ->
+ * necessary for Dev2MountByDev() in routines/misc.ycp
+ */
+global map<string,map> all_partitions = $[];
+
+/**
+ * bnc #468922 - problem with longtime running the parsing a huge number of
disks
+ * map<string,map> target map try to minimalize calling Storage::GetTargetMap()
+ *
+ */
+map<string,map> target_map = $[];
+
global define string getLoaderType (boolean recheck);
global define list<string> getBootloaders ();
global define list<string> Summary ();

Modified: branches/SuSE-Code-11-Branch/bootloader/src/routines/misc.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/bootloader/src/routines/misc.ycp?rev=55041&r1=55040&r2=55041&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/bootloader/src/routines/misc.ycp (original)
+++ branches/SuSE-Code-11-Branch/bootloader/src/routines/misc.ycp Mon Jan 26
16:55:07 2009
@@ -574,6 +574,38 @@
return temp_sec;
}

+/**
+ * bnc #468922 - problem with longtime running the parsing a huge number of
disks
+ * Function initialize BootCommon::all_partitions only if storage change
+ * partitioning of disk
+ * true if init all_partitions
+ */
+
+boolean MapAllPartitions()
+{
+ boolean ret = false;
+ if (saved_last_change_time_from_storage != Storage::GetTargetChangeTime())
+ {
+ // save last change time from storage for MapAllPartitions()
+ saved_last_change_time_from_storage = Storage::GetTargetChangeTime();
+
+ BootCommon::all_partitions = $[];
+ BootCommon::target_map = $[];
+ // get target map
+ BootCommon::target_map = (map<string,map>)Storage::GetTargetMap();
+ // map all partitions
+ foreach (string k, map v, BootCommon::target_map,
+ {
+ foreach (map p, (list<map>)(v["partitions"]:[]),
+ {
+ all_partitions[p["device"]:""] = p;
+ });
+ });
+ ret = true;
+ }
+
+ return ret;
+}

/** FATE #302219 - Use and choose persistent device names for disk devices
* Converts a device name to the corresponding device name it should be
@@ -599,18 +631,13 @@
//by_mount = `id;
y2milestone("Default mount by is %1", by_mount);

- map<string,map> devices = (map<string,map>)Storage::GetTargetMap();
-
- // make a map: "/dev/hda1" -> info_map_for_this_partition
- map<string,map> partitions = $[];
- foreach (string k, map v, devices,
- {
- foreach (map p, (list<map>)(v["partitions"]:[]),
- {
- partitions[p["device"]:""] = p;
- });
- });
+ // add all_partitions to partitions
+ if (MapAllPartitions())
+ y2milestone("Init BootCommon::all_partitions was done");

+ map<string,map> partitions = BootCommon::all_partitions;
+ map<string,map> devices = BootCommon::target_map;
+
string ret = dev;
switch(by_mount)
{

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages