// -*- 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 #include #include #include #include using namespace std; #include "config.h" #include "osd/OSDMap.h" #include "mon/MonMap.h" void usage(const char *me) { cout << me << " usage: [--print] [--createsimple [--clobber] [--pgbits ]] " << std::endl; cout << me << " --export-crush write osdmap's crush map to " << std::endl; cout << me << " --import-crush replace osdmap's crush map with " << std::endl; exit(1); } void printmap(const char *me, OSDMap *m) { cout << me << ": osdmap: epoch " << m->get_epoch() << std::endl << me << ": osdmap: fsid " << m->get_fsid() << std::endl; /*for (unsigned i=0; imon_inst.size(); i++) cout << me << ": osdmap: " //<< "mon" << i << " " << m->mon_inst[i] << std::endl; */ } int main(int argc, const char **argv) { vector args; argv_to_vec(argc, argv, args); parse_config_options(args); const char *me = argv[0]; const char *fn = 0; bool print = false; bool createsimple = false; const char *monmapfn = 0; int num_osd = 0; int pg_bits = g_conf.osd_pg_bits; bool clobber = false; bool modified = false; const char *export_crush = 0; const char *import_crush = 0; list add, rm; for (unsigned i=0; i= 0); } return 0; }