// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- /* * 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/MDCluster.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" #define NUMMDS g_conf.num_mds #define NUMOSD g_conf.num_osd #define NUMCLIENT g_conf.num_client class C_Test : public Context { public: void finish(int r) { cout << "C_Test->finish(" << r << ")" << endl; } }; int main(int argc, char **argv) { cerr << "fakesyn start" << endl; //cerr << "inode_t " << sizeof(inode_t) << endl; vector args; argv_to_vec(argc, argv, args); parse_config_options(args); int start = 0; parse_syn_options(args); vector nargs; for (unsigned i=0; iinit(); } for (int i=0; iinit(); if (g_conf.mds_local_osd) mdsosd[i]->init(); } for (int i=0; iinit(); } // create client(s) for (int i=0; iinit(); // use my argc, argv (make sure you pass a mount point!) //cout << "mounting" << endl; client[i]->mount(); //cout << "starting synthetic client " << endl; syn[i] = new SyntheticClient(client[i]); syn[i]->start_thread(); } for (int i=0; ijoin_thread(); delete syn[i]; client[i]->unmount(); //cout << "unmounted" << endl; client[i]->shutdown(); } // wait for it to finish fakemessenger_wait(); // cleanup for (int i=0; i