From mboxrd@z Thu Jan 1 00:00:00 1970 From: kupcevic@sourceware.org Date: 26 Sep 2006 03:20:47 -0000 Subject: [Cluster-devel] conga/ricci/modules/storage FSController.cpp Message-ID: <20060926032047.2775.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --- conga/ricci/modules/storage/FSController.cpp 2006/09/26 03:02:57 1.6 +++ conga/ricci/modules/storage/FSController.cpp 2006/09/26 03:20:47 1.7 @@ -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(new ExtendedFS(path)); } catch ( ... ) {} try { + return counting_auto_ptr(new GFS1(path)); + } catch ( ... ) {} + try { + return counting_auto_ptr(new GFS2(path)); + } catch ( ... ) {} + try { return counting_auto_ptr(new SwapFS(path)); } catch ( ... ) {} - throw String("not FS"); + return counting_auto_ptr(new UnsupportedFS(path)); } std::list > @@ -51,6 +60,12 @@ cnts.push_back(counting_auto_ptr(new ExtendedFSTemplate())); } catch ( ... ) {} try { + cnts.push_back(counting_auto_ptr(new GFS1Template())); + } catch ( ... ) {} + try { + cnts.push_back(counting_auto_ptr(new GFS2Template())); + } catch ( ... ) {} + try { cnts.push_back(counting_auto_ptr(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