]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/librgw.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab ft=cpp
5 * Ceph - scalable distributed file system
7 * Copyright (C) 2022 New Dream Network
9 * This is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License version 2.1, as published by the Free Software
12 * Foundation. See file COPYING.
16 #include <sys/types.h>
20 #include "include/rados/librgw.h"
22 #include "include/str_list.h"
23 #include "common/ceph_argparse.h"
24 #include "common/ceph_context.h"
25 #include "common/dout.h"
34 #define dout_subsys ceph_subsys_rgw
38 bool global_stop
= false;
39 static std::mutex librgw_mtx
;
46 int librgw_create(librgw_t
* rgw
, int argc
, char **argv
)
54 if (! g_ceph_context
) {
55 std::lock_guard
<std::mutex
> lg(librgw_mtx
);
56 if (! g_ceph_context
) {
57 std::vector
<std::string
> spl_args
;
58 // last non-0 argument will be split and consumed
60 const std::string spl_arg
{argv
[(--argc
)]};
61 get_str_vec(spl_arg
, " \t", spl_args
);
63 auto args
= argv_to_vec(argc
, argv
);
64 // append split args, if any
65 for (const auto& elt
: spl_args
) {
66 args
.push_back(elt
.c_str());
68 rc
= rgwlib
.init(args
);
72 *rgw
= g_ceph_context
->get();
77 void librgw_shutdown(librgw_t rgw
)
81 CephContext
* cct
= static_cast<CephContext
*>(rgw
);
84 dout(1) << "final shutdown" << dendl
;