// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2004-2006 Sage Weil * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software * Foundation. See file COPYING. * */ #include #include #include using namespace std; #include "config.h" #include "mds/MDS.h" #include "osd/OSD.h" #include "mon/Monitor.h" #include "client/Client.h" #include "client/SyntheticClient.h" #include "msg/FakeMessenger.h" #include "common/Timer.h" class C_Test : public Context { public: void finish(int r) { cout << "C_Test->finish(" << r << ")" << std::endl; } }; class C_Die : public Context { public: void finish(int) { cerr << "die" << std::endl; exit(1); } }; int main(int argc, char **argv) { cerr << "fakesyn start" << std::endl; //cerr << "inode_t " << sizeof(inode_t) << std::endl; vector args; argv_to_vec(argc, argv, args); // stop on our own (by default) g_conf.mon_stop_on_last_unmount = true; g_conf.mon_stop_with_last_mds = true; parse_config_options(args); int start = 0; parse_syn_options(args); vector nargs; for (unsigned i=0; imon_inst[i] = entity_inst_t(entity_name_t::MON(i), a); // hack ; see FakeMessenger.cc } char hostname[100]; gethostname(hostname,100); //int pid = getpid(); // create mon Monitor *mon[g_conf.num_mon]; for (int i=0; iinit(); } for (int i=0; iinit(); } for (int i=0; iinit(); if (g_conf.mds_local_osd) mdsosd[i]->init(); } // create client(s) Client *client[g_conf.num_client]; SyntheticClient *syn[g_conf.num_client]; for (int i=0; istart_thread(); start++; } for (int i=0; ijoin_thread(); delete syn[i]; } // wait for it to finish fakemessenger_wait(); // cleanup for (int i=0; i