]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 9 Jun 2005 15:39:23 +0000 (15:39 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 9 Jun 2005 15:39:23 +0000 (15:39 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@286 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/config.cc
ceph/config.h
ceph/fakesyn.cc

index 97dccae4d0d45fb7ae4ff74c5919f7bcc8dfbeb2..d03f5ec147fc7998502b94354907f6252bb78eea 100644 (file)
@@ -38,13 +38,14 @@ md_config_t g_conf = {
   mds_log_max_len:  10000,//MDS_CACHE_SIZE / 3,
   mds_log_max_trimming: 16,
   mds_log_read_inc: 65536,
+  mds_log_before_reply: true,
+  mds_log_flush_on_shutdown: true,
 
   mds_bal_replicate_threshold: 500,
   mds_bal_unreplicate_threshold: 200,
   mds_bal_interval: 200,
 
   mds_verify_export_dirauth: true,
-  mds_log_before_reply: true,
 
   // --- fakeclient (mds regression testing) ---
   num_fakeclient: 100,
@@ -82,26 +83,39 @@ md_config_t g_conf = {
 
 #include <stdlib.h>
 #include <string.h>
+#include <iostream>
+using namespace std;
 
 void parse_config_options(int argc, char **argv,
-                                                 int& nargc, (char**)&nargv)
+                                                 int& nargc, char**&nargv)
 {
   // alloc new argc
-  nargv = new (char*)[argc];
+  nargv = (char**)malloc(sizeof(char*) * argc);
   nargc = 0;
   nargv[nargc++] - argv[0];
 
   for (int i=1; i<argc; i++) {
-       if (strcmp(argv[i], "--nummds") == 0) g_conf.nummds = atoi(argv[++i]);
-       else if (strcmp(argv[i], "--numclient") == 0) g_conf.numclient = atoi(argv[++i]);
-       else if (strcmp(argv[i], "--numosd") == 0) g_conf.numosd = atoi(argv[++i]);
-       else if (strcmp(argv[i], "--debug") == 0) g_conf.debug = atoi(argv[++i]);
-       else if (strcmp(argv[i], "--mds_cache_size") == 0) g_conf.mds_cache_size = atoi(argv[++i]);
-       else if (strcmp(argv[i], "--mds_log_max_len") == 0) g_conf.mds_log_max_len = atoi(argv[++i]);
-       else if (strcmp(argv[i], "--mds_log_max_trimming") == 0) g_conf.mds_log_max_trimming = atoi(argv[++i]);
-       else if (strcmp(argv[i], "--mds_bal_interval") == 0) g_conf.mds_bal_interval = atoi(argv[++i]);
-       else 
+       if (strcmp(argv[i], "--nummds") == 0) 
+         g_conf.num_mds = atoi(argv[++i]);
+       else if (strcmp(argv[i], "--numclient") == 0) 
+         g_conf.num_client = atoi(argv[++i]);
+       else if (strcmp(argv[i], "--numosd") == 0) 
+         g_conf.num_osd = atoi(argv[++i]);
+       else if (strcmp(argv[i], "--debug") == 0) 
+         g_conf.debug = atoi(argv[++i]);
+       else if (strcmp(argv[i], "--mds_cache_size") == 0) 
+         g_conf.mds_cache_size = atoi(argv[++i]);
+       else if (strcmp(argv[i], "--mds_log_max_len") == 0) 
+         g_conf.mds_log_max_len = atoi(argv[++i]);
+       else if (strcmp(argv[i], "--mds_log_max_trimming") == 0) 
+         g_conf.mds_log_max_trimming = atoi(argv[++i]);
+       else if (strcmp(argv[i], "--mds_log_flush_on_shutdown") == 0) 
+         g_conf.mds_log_flush_on_shutdown = atoi(argv[++i]);
+       else if (strcmp(argv[i], "--mds_bal_interval") == 0) 
+         g_conf.mds_bal_interval = atoi(argv[++i]);
+       else {
+         cout << "passing arg " << argv[i] << endl;
          nargv[nargc++] = argv[i];
-
+       }
   }
 }
index 10d61958e2ce74f778f1b720f13a0948cbf16aa6..557aa15ed969a9b6872705e6175d57d18180695d 100644 (file)
@@ -30,13 +30,14 @@ struct md_config_t {
   int mds_log_max_len;
   int mds_log_max_trimming;
   int mds_log_read_inc;
+  bool  mds_log_before_reply;
+  bool  mds_log_flush_on_shutdown;
   
   float mds_bal_replicate_threshold;
   float mds_bal_unreplicate_threshold;
   int   mds_bal_interval;
 
   bool  mds_verify_export_dirauth;     // debug flag
-  bool  mds_log_before_reply;
 
   // fake client
   int      num_fakeclient;
@@ -77,4 +78,7 @@ extern md_config_t g_conf;
 #define dout(x)  if ((x) <= g_conf.debug) cout
 #define dout2(x) if ((x) <= g_conf.debug) cout
 
+void parse_config_options(int argc, char **argv,
+                                                 int& nargc, char**&nargv);
+
 #endif
index 314160e2cc86fe5e2ae53f0241448b77ccd9e21f..6aa4f2282735c35253800b53b527d8069590da74 100644 (file)
@@ -30,9 +30,13 @@ public:
 };
 
 
-int main(int argc, char **argv) {
+int main(int oargc, char **oargv) {
 
   //cerr << "mpisyn starting " << myrank << "/" << world << endl;
+  int argc;
+  char **argv;
+  parse_config_options(oargc, oargv,
+                                          argc, argv);
 
   int start = 0;
 
@@ -51,16 +55,6 @@ int main(int argc, char **argv) {
        else if (strcmp(argv[i], "--fullmkfs") == 0) {
          mkfs = MDS_MKFS_FULL;
        }
-
-       else if (strcmp(argv[i],"--numosd") == 0) {
-         g_conf.num_osd = atoi(argv[++i]);
-       }
-       else if (strcmp(argv[i],"--numclient") == 0) {
-         g_conf.num_client = atoi(argv[++i]);
-       }
-       else if (strcmp(argv[i],"--nummds") == 0) {
-         g_conf.num_mds = atoi(argv[++i]);
-       }
        else if (strcmp(argv[i],"--synthetic") == 0) {
          synthetic = atoi(argv[++i]);
        }