]> git.proxmox.com Git - ceph.git/blame - ceph/src/tools/cephfs/cephfs-journal-tool.cc
bump version to 18.2.2-pve1
[ceph.git] / ceph / src / tools / cephfs / cephfs-journal-tool.cc
CommitLineData
7c673cae
FG
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3/*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2014 John Spray <john.spray@inktank.com>
7 *
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
12 */
13
14
15#include "include/types.h"
16#include "common/config.h"
17#include "common/ceph_argparse.h"
18#include "common/errno.h"
19#include "global/global_init.h"
20
21#include "JournalTool.h"
22
23
24int main(int argc, const char **argv)
25{
20effc67 26 auto args = argv_to_vec(argc, argv);
11fdf7f2 27 if (args.empty()) {
20effc67 28 std::cerr << argv[0] << ": -h or --help for usage" << std::endl;
11fdf7f2
TL
29 exit(1);
30 }
31 if (ceph_argparse_need_usage(args)) {
32 JournalTool::usage();
33 exit(0);
34 }
7c673cae
FG
35
36 auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
37 CODE_ENVIRONMENT_UTILITY, 0);
38 common_init_finish(g_ceph_context);
39
40 JournalTool jt;
41
7c673cae
FG
42 // Connect to mon cluster, download MDS map etc
43 int rc = jt.init();
44 if (rc != 0) {
45 std::cerr << "Error in initialization: " << cpp_strerror(rc) << std::endl;
46 return rc;
47 }
48
49 // Finally, execute the user's commands
50 rc = jt.main(args);
51 if (rc != 0) {
52 std::cerr << "Error (" << cpp_strerror(rc) << ")" << std::endl;
53 }
54
7c673cae
FG
55 return rc;
56}
57