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

ceph/config.cc
ceph/config.h
ceph/mds/IdAllocator.cc
ceph/mds/IdAllocator.h
ceph/mds/MDLog.cc
ceph/mds/MDS.cc

index f3f38945c46848e73216997288b21105553d9629..c3fa8e4a46f02d2537d3ea8d111d168145b7a34d 100644 (file)
@@ -19,7 +19,7 @@ md_config_t g_conf = {
   // profiling and debugging
   log_messages: true,
   log_interval: 1,
-  log_name: 0,
+  log_name: (char*)0,
 
   fake_clock: false,
   fakemessenger_serialize: true,
@@ -36,6 +36,7 @@ md_config_t g_conf = {
   mds_cache_size: MDS_CACHE_SIZE,
   mds_cache_mid: .7,
 
+  mds_log: true,
   mds_log_max_len:  10000,//MDS_CACHE_SIZE / 3,
   mds_log_max_trimming: 16,
   mds_log_read_inc: 65536,
@@ -118,6 +119,11 @@ void parse_config_options(int argc, char **argv,
 
        else if (strcmp(argv[i], "--mds_cache_size") == 0) 
          g_conf.mds_cache_size = atoi(argv[++i]);
+
+       else if (strcmp(argv[i], "--mds_log") == 0) 
+         g_conf.mds_log = atoi(argv[++i]);
+       else if (strcmp(argv[i], "--mds_log_before_reply") == 0) 
+         g_conf.mds_log_before_reply = 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) 
@@ -128,8 +134,7 @@ void parse_config_options(int argc, char **argv,
          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 if (strcmp(argv[i], "--mds_log_before_reply") == 0) 
-         g_conf.mds_log_before_reply = atoi(argv[++i]);
+
 
 
        else if (strcmp(argv[i], "--osd_fsync") == 0) 
index 80e05573a514db99369913470b754654b852460b..3f4cbdb213f0fcbe6c1f62ee6accb831ff4d5e37 100644 (file)
@@ -28,6 +28,7 @@ struct md_config_t {
   int   mds_cache_size;
   float mds_cache_mid;
 
+  bool mds_log;
   int mds_log_max_len;
   int mds_log_max_trimming;
   int mds_log_read_inc;
index aa0fd9a5d84afa5996d39872ce6b8fe3fddaf13e..3eea14a1bc9f111496e821fb399b7ea35c657c24 100644 (file)
@@ -24,7 +24,7 @@ idno_t IdAllocator::get_id(int type)
   free[type].erase(id);
   dout(DBLEVEL) << "idalloc " << this << ": getid type " << type << " is " << id << endl;
   //free[type].dump();
-  save();
+  //save();
   return id;
 }
 
@@ -35,7 +35,7 @@ void IdAllocator::reclaim_id(int type, idno_t id)
   dout(DBLEVEL) << "idalloc " << this << ": reclaim type " << type << " id " << id << endl;
   free[type].insert(id);
   //free[type].dump();
-  save();
+  //save();
 }
 
 
@@ -92,8 +92,8 @@ void IdAllocator::reset()
   free.clear();
 
   // use generic range FIXME THIS IS CRAP
-  free[ID_INO].map_insert((long long)1000000LL * (mds->get_nodeid()+1),
-                                                 (long long)1000000LL * (mds->get_nodeid()+2) - 1);
+  free[ID_INO].map_insert((long long)100000000LL * (mds->get_nodeid()+1),
+                                                 (long long)100000000LL * (mds->get_nodeid()+2) - 1);
   //free[ID_INO].dump();
   
   free[ID_FH].map_insert(1000000LL * (mds->get_nodeid()+1),
index 95089fd2c5fef486bee4bd79706f5f5a2b111922..93f1e587e43e946939a39a0b20016168c8b5732a 100644 (file)
@@ -38,6 +38,10 @@ class IdAllocator {
 
   void reset();
 
+  void shutdown() {
+       if (is_open()) save();
+  }
+
   void save();
   void load(Context *onfinish);
   void load_2(int, bufferlist&, Context *onfinish);
index 42ddf5e6a0ec15c1d79b97d07bef02289bfa4c75..4bbf1e05c08baafc333ab88d8fda0cc5c9b1111d 100644 (file)
@@ -69,6 +69,14 @@ public:
 int MDLog::submit_entry( LogEvent *e,
                                                 Context *c ) 
 {
+  if (!g_conf.mds_log) {
+       if (c) {
+         c->finish(0);
+         delete c;
+       }
+       return 0;
+  }
+
   dout(5) << "submit_entry" << endl;
 
   // write it
index 317020aa64a6944ca0b9fbab4d5d71a8ef091912..b3a0b7716cca589536256f60c643932e6cf555d7 100644 (file)
@@ -159,6 +159,8 @@ int MDS::shutdown_start()
                                                        MDS_PORT_MAIN);
   }
 
+  if (idalloc) idalloc->shutdown();
+  
   handle_shutdown_start(NULL);
 }