From: sage Date: Mon, 13 Jun 2005 23:20:46 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v0.1~2074 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5053f46f2f87b71bf3f5c910e7e3c9d8dd54e1e3;p=ceph.git *** empty log message *** git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@307 29311d96-e01e-0410-9327-a35deaab8ce9 --- diff --git a/ceph/config.cc b/ceph/config.cc index f3f38945c46..c3fa8e4a46f 100644 --- a/ceph/config.cc +++ b/ceph/config.cc @@ -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) diff --git a/ceph/config.h b/ceph/config.h index 80e05573a51..3f4cbdb213f 100644 --- a/ceph/config.h +++ b/ceph/config.h @@ -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; diff --git a/ceph/mds/IdAllocator.cc b/ceph/mds/IdAllocator.cc index aa0fd9a5d84..3eea14a1bc9 100644 --- a/ceph/mds/IdAllocator.cc +++ b/ceph/mds/IdAllocator.cc @@ -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), diff --git a/ceph/mds/IdAllocator.h b/ceph/mds/IdAllocator.h index 95089fd2c5f..93f1e587e43 100644 --- a/ceph/mds/IdAllocator.h +++ b/ceph/mds/IdAllocator.h @@ -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); diff --git a/ceph/mds/MDLog.cc b/ceph/mds/MDLog.cc index 42ddf5e6a0e..4bbf1e05c08 100644 --- a/ceph/mds/MDLog.cc +++ b/ceph/mds/MDLog.cc @@ -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 diff --git a/ceph/mds/MDS.cc b/ceph/mds/MDS.cc index 317020aa64a..b3a0b7716cc 100644 --- a/ceph/mds/MDS.cc +++ b/ceph/mds/MDS.cc @@ -159,6 +159,8 @@ int MDS::shutdown_start() MDS_PORT_MAIN); } + if (idalloc) idalloc->shutdown(); + handle_shutdown_start(NULL); }