Skip to contentSkip to conversation

conga/ricci/modules/storage FSController.cpp

Cluster-devel [email protected] 1 participant 1 message Sep 26, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: kupcevic at sourceware.org 2006-09-26 03:20:47

Modified files:
ricci/modules/storage: FSController.cpp

Log message:
storage module: add full GFS1/2 support, and detection of multiple other filesystems (so they don't get overwriten)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/FSController.cpp.diff?cvsroot=cluster&r1=1.6&r2=1.7

ricci/modules/storage/FSController.cpp +20 -1
@@ -24,6 +24,9 @@
 #include "FSController.h"
 #include "ExtendedFS.h"
 #include "SwapFS.h"
+#include "GFS1.h"
+#include "GFS2.h"
+#include "UnsupportedFS.h"
 #include "utils.h"
 
 
@@ -37,9 +40,15 @@
     return counting_auto_ptr<Content>(new ExtendedFS(path));
   } catch ( ... ) {}
   try {
+    return counting_auto_ptr<Content>(new GFS1(path));
+  } catch ( ... ) {}
+  try {
+    return counting_auto_ptr<Content>(new GFS2(path));
+  } catch ( ... ) {}
+  try {
     return counting_auto_ptr<Content>(new SwapFS(path));
   } catch ( ... ) {}
-  throw String("not FS");
+  return counting_auto_ptr<Content>(new UnsupportedFS(path));
 }
 
 std::list<counting_auto_ptr<ContentTemplate> > 
@@ -51,6 +60,12 @@
     cnts.push_back(counting_auto_ptr<ContentTemplate>(new ExtendedFSTemplate()));
   } catch ( ... ) {}
   try {
+    cnts.push_back(counting_auto_ptr<ContentTemplate>(new GFS1Template()));
+  } catch ( ... ) {}
+  try {
+    cnts.push_back(counting_auto_ptr<ContentTemplate>(new GFS2Template()));
+  } catch ( ... ) {}
+  try {
     cnts.push_back(counting_auto_ptr<ContentTemplate>(new SwapFSTemplate()));
   } catch ( ... ) {}
   
@@ -67,6 +82,10 @@
   String fs_type = cont_templ->attrs["fs_type"];
   if (fs_type == ExtendedFS::PRETTY_NAME)
     create_extended_fs(bd->path(), cont_templ);
+  else if (fs_type == GFS1::PRETTY_NAME)
+    create_GFS1(bd->path(), cont_templ);
+  else if (fs_type == GFS2::PRETTY_NAME)
+    create_GFS2(bd->path(), cont_templ);
   else if (fs_type == SwapFS::PRETTY_NAME)
     create_swap_fs(bd->path(), cont_templ);
   else