[Cluster-devel] conga/ricci/modules/storage MountHandler.cpp V ...

kupcevic at sourceware.org kupcevic at sourceware.org
Tue Sep 26 01:16:14 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	kupcevic at sourceware.org	2006-09-26 01:16:13

Modified files:
	ricci/modules/storage: MountHandler.cpp VG.cpp BDFactory.cpp 
	                       LV.cpp MDRaid.cpp MDRaidTarget.cpp 

Log message:
	storage module: minor code cleanup

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/MountHandler.cpp.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/VG.cpp.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/BDFactory.cpp.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LV.cpp.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/MDRaid.cpp.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/MDRaidTarget.cpp.diff?cvsroot=cluster&r1=1.3&r2=1.4

--- conga/ricci/modules/storage/MountHandler.cpp	2006/08/10 22:53:09	1.3
+++ conga/ricci/modules/storage/MountHandler.cpp	2006/09/26 01:16:13	1.4
@@ -356,14 +356,15 @@
   String dev(utils::strip(devname));
   String mnt(utils::strip(mountpoint));
   
+  String buff;
+  bool modified = false;
   FILE* fstab = fopen(fstab_path.c_str(), "r");
   if (!fstab)
     throw String("unable to open ") + fstab_path;
-  String buff;
-  bool modified = false;
   try {
     bool done = false;
     while (!done) {
+      String line;
       char* ptr = NULL;
       int size;
       size_t tmp;
@@ -377,7 +378,6 @@
 	  throw String("error reading fstab");
 	}
       }
-      String line;
       try {
 	line = String(ptr, size);
 	free(ptr);
@@ -438,6 +438,7 @@
   try {
     bool done = false;
     while (!done) {
+      String line;
       char* ptr = NULL;
       int size;
       size_t tmp;
@@ -451,7 +452,6 @@
 	  throw String("error reading /proc/filesystems");
 	}
       }
-      String line;
       try {
 	line = utils::strip(String(ptr, size));
 	free(ptr);
--- conga/ricci/modules/storage/VG.cpp	2006/08/10 22:53:09	1.5
+++ conga/ricci/modules/storage/VG.cpp	2006/09/26 01:16:13	1.6
@@ -55,8 +55,8 @@
   int status;
   if (utils::execute(LVM_BIN_PATH, args, out, err, status))
     throw String("execute failed");
-  if (status != 0)
-    throw String("vgdisplay failed");
+  if (status)
+    throw String("vgs failed");
   vector<String> lines = utils::split(out, "\n");
   for (vector<String>::iterator iter = lines.begin();
        iter != lines.end();
--- conga/ricci/modules/storage/BDFactory.cpp	2006/08/10 22:53:09	1.3
+++ conga/ricci/modules/storage/BDFactory.cpp	2006/09/26 01:16:13	1.4
@@ -22,7 +22,6 @@
 
 
 #include "BDFactory.h"
-#include "ContentFactory.h"
 #include "MapperFactory.h"
 #include "LV.h"
 #include "Partition.h"
--- conga/ricci/modules/storage/LV.cpp	2006/08/10 22:53:09	1.5
+++ conga/ricci/modules/storage/LV.cpp	2006/09/26 01:16:13	1.6
@@ -118,8 +118,8 @@
     
     // adjust size based on snap_percent
     long long usage = _props.get("snapshot_usage_percent").get_int();
-    Variable size_var(_props.get("size"));
-    XMLObject xml(size_var.xml());
+    const Variable size_var(_props.get("size"));
+    const XMLObject xml(size_var.xml());
     long long size = size_var.get_int();
     long long min  = utils::to_long(xml.get_attr("min"));
     long long max  = utils::to_long(xml.get_attr("max"));
@@ -135,8 +135,8 @@
       _props.set(Variable("size", size, min, max, step));
   } else {
     // adjust size based on content
-    Variable size_var(_props.get("size"));
-    XMLObject xml(size_var.xml());
+    const Variable size_var(_props.get("size"));
+    const XMLObject xml(size_var.xml());
     long long size = size_var.get_int();
     long long min  = utils::to_long(xml.get_attr("min"));
     long long max  = utils::to_long(xml.get_attr("max"));
--- conga/ricci/modules/storage/MDRaid.cpp	2006/08/10 22:53:09	1.6
+++ conga/ricci/modules/storage/MDRaid.cpp	2006/09/26 01:16:13	1.7
@@ -116,7 +116,6 @@
 {
   bool active_old = _props.get("active").get_bool();
   bool active_new = mp.props.get("active").get_bool();
-  
   if (active_old && !active_new)
     // FIXME: umount FS before stoping, disabled for now (see constructor)
     mdadm::stop_raid(_raid);
--- conga/ricci/modules/storage/MDRaidTarget.cpp	2006/08/10 22:53:09	1.3
+++ conga/ricci/modules/storage/MDRaidTarget.cpp	2006/09/26 01:16:13	1.4
@@ -26,7 +26,6 @@
 #include "FSController.h"
 #include "defines.h"
 #include "utils.h"
-#include "ContentFactory.h"
 #include "ContentNone.h"
 
 




More information about the Cluster-devel mailing list