#define CEPH_AUTHAUTHORIZEHANDLER_H
#include "Auth.h"
+#include "include/common_fwd.h"
#include "include/types.h"
#include "common/ceph_mutex.h"
// Different classes of session crypto handling
#define SESSION_SYMMETRIC_AUTHENTICATE 1
#define SESSION_SYMMETRIC_ENCRYPT 2
-class CephContext;
class KeyRing;
struct AuthAuthorizeHandler {
#include "auth/Auth.h"
+#include "include/common_fwd.h"
-class CephContext;
struct MAuthReply;
class RotatingKeyRing;
#ifndef CEPH_AUTHMETHODLIST_H
#define CEPH_AUTHMETHODLIST_H
+#include "include/common_fwd.h"
#include "include/int_types.h"
#include <list>
#include <set>
#include <string>
-class CephContext;
-
class AuthMethodList {
std::list<__u32> auth_supported;
public:
#pragma once
#include "AuthRegistry.h"
+#include "include/common_fwd.h"
#include <vector>
-class CephContext;
class Connection;
class AuthServer {
#include <stddef.h> // for NULL
#include <stdint.h> // for uint64_t
#include "common/entity_name.h" // for EntityName
+#include "include/common_fwd.h"
#include "include/buffer_fwd.h" // for ceph::buffer::list
-class CephContext;
class KeyServer;
class CryptoKey;
struct AuthCapsInfo;
#ifndef CEPH_AUTHSESSIONHANDLER_H
#define CEPH_AUTHSESSIONHANDLER_H
+#include "include/common_fwd.h"
#include "include/types.h"
#include "Auth.h"
// Defines the security applied to ongoing messages in a session, once the session is established. PLR
-class CephContext;
class Message;
struct AuthSessionHandler {
sha256_digest_t CryptoKeyHandler::hmac_sha256(
const ceph::bufferlist& in) const
{
- ceph::crypto::HMACSHA256 hmac((const unsigned char*)secret.c_str(), secret.length());
+ TOPNSPC::crypto::HMACSHA256 hmac((const unsigned char*)secret.c_str(), secret.length());
for (const auto& bptr : in.buffers()) {
hmac.Update((const unsigned char *)bptr.c_str(), bptr.length());
#ifndef CEPH_AUTH_CRYPTO_H
#define CEPH_AUTH_CRYPTO_H
+#include "include/common_fwd.h"
#include "include/types.h"
#include "include/utime.h"
#include "include/buffer.h"
#include <string>
-class CephContext;
class CryptoKeyContext;
namespace ceph { class Formatter; }
#define CEPH_KEYRING_H
#include "auth/Auth.h"
-
-class CephContext;
+#include "include/common_fwd.h"
class KeyRing : public KeyStore {
std::map<EntityName, EntityAuth> keys;
#include "common/ceph_mutex.h"
#include "auth/Auth.h"
+#include "include/common_fwd.h"
/*
* mediate access to a service's keyring and rotating secrets
*/
class KeyRing;
-class CephContext;
class RotatingKeyRing : public KeyStore {
CephContext *cct;
#define CEPH_CEPHXAUTHORIZEHANDLER_H
#include "auth/AuthAuthorizeHandler.h"
-
-class CephContext;
+#include "include/common_fwd.h"
struct CephxAuthorizeHandler : public AuthAuthorizeHandler {
bool verify_authorizer(
#include "auth/AuthClientHandler.h"
#include "CephxProtocol.h"
#include "auth/RotatingKeyRing.h"
+#include "include/common_fwd.h"
-class CephContext;
class KeyRing;
class CephxClientHandler : public AuthClientHandler {
#include "CephxProtocol.h"
#include "CephxKeyServer.h"
#include "common/ceph_mutex.h"
-
-class CephContext;
+#include "include/common_fwd.h"
struct KeyServerData {
version_t version;
#include <errno.h>
#include <sstream>
-class CephContext;
-
+#include "include/common_fwd.h"
/*
* Authentication
*/
#include "auth/AuthSessionHandler.h"
#include "auth/Auth.h"
+#include "include/common_fwd.h"
-class CephContext;
class Message;
class CephxSessionHandler : public AuthSessionHandler {
#include "auth/AuthClientHandler.h"
#include "auth/RotatingKeyRing.h"
+#include "include/common_fwd.h"
#include "KrbProtocol.hpp"
#include <gssapi/gssapi_ext.h>
-class CephContext;
class Keyring;
#define CEPH_AUTHNONEAUTHORIZEHANDLER_H
#include "auth/AuthAuthorizeHandler.h"
-
-class CephContext;
+#include "include/common_fwd.h"
struct AuthNoneAuthorizeHandler : public AuthAuthorizeHandler {
bool verify_authorizer(
#define CEPH_AUTHNONEPROTOCOL_H
#include "auth/Auth.h"
-
-class CephContext;
+#include "include/common_fwd.h"
struct AuthNoneAuthorizer : public AuthAuthorizer {
AuthNoneAuthorizer() : AuthAuthorizer(CEPH_AUTH_NONE) { }
#include "auth/AuthServiceHandler.h"
#include "auth/Auth.h"
-
-class CephContext;
+#include "include/common_fwd.h"
class AuthNoneServiceHandler : public AuthServiceHandler {
public:
#include "common/ceph_mutex.h"
#include "common/cmdparse.h"
#include "common/compiler_extensions.h"
+#include "include/common_fwd.h"
#include "include/cephfs/ceph_statx.h"
#include "include/filepath.h"
#include "include/interval_set.h"
class FSMapUser;
class MonClient;
-class CephContext;
struct DirStat;
struct LeaseStat;
class Objecter;
class WritebackHandler;
-class PerfCounters;
class MDSMap;
class Message;
#define CEPH_FINISHER_H
#include "include/Context.h"
+#include "include/common_fwd.h"
#include "common/Thread.h"
#include "common/ceph_mutex.h"
#include "common/perf_counters.h"
#include "common/Cond.h"
-class CephContext;
/// Finisher queue length performance counter ID.
enum {
#include "common/ceph_time.h"
#include "common/ceph_mutex.h"
-
-class CephContext;
+#include "include/common_fwd.h"
namespace ceph {
#ifndef CEPH_MEMORYMODEL_H
#define CEPH_MEMORYMODEL_H
-class CephContext;
+#include "include/common_fwd.h"
class MemoryModel {
public:
#include "common/ceph_mutex.h"
#include "common/Thread.h"
+#include "include/common_fwd.h"
#include "include/buffer.h"
-class CephContext;
class OutputDataSocket : public Thread
{
#include <map>
#include <string>
#include "common/ceph_mutex.h"
-
-class CephContext;
+#include "include/common_fwd.h"
extern "C" {
const char *__ceph_plugin_version();
#include "common/dout.h"
#include "common/valgrind.h"
+namespace TOPNSPC::common {
RefCountedObject::~RefCountedObject()
{
ceph_assert(nref == 0);
<< (v - 1) << " -> " << v << dendl;
}
}
+
+}
#include "common/ceph_mutex.h"
#include "common/ref.h"
+#include "include/common_fwd.h"
#include <atomic>
* constructors.
*
*/
-
+namespace TOPNSPC::common {
class RefCountedObject {
public:
- void set_cct(class CephContext *c) {
+ void set_cct(CephContext *c) {
cct = c;
}
RefCountedObject& operator=(const RefCountedObject& o) = delete;
RefCountedObject(RefCountedObject&&) = delete;
RefCountedObject& operator=(RefCountedObject&&) = delete;
- RefCountedObject(class CephContext* c) : cct(c) {}
+ RefCountedObject(CephContext* c) : cct(c) {}
virtual ~RefCountedObject();
// crimson is single threaded at the moment
mutable uint64_t nref{1};
#endif
- class CephContext *cct{nullptr};
+ CephContext *cct{nullptr};
};
class RefCountedObjectSafe : public RefCountedObject {
static inline void intrusive_ptr_release(const RefCountedObject *p) {
p->put();
}
-
-using RefCountedPtr = ceph::ref_t<RefCountedObject>;
+}
+using RefCountedPtr = ceph::ref_t<TOPNSPC::common::RefCountedObject>;
#endif
#define CEPH_TIMER_H
#include <map>
+#include "include/common_fwd.h"
#include "ceph_time.h"
#include "ceph_mutex.h"
-class CephContext;
class Context;
class SafeTimerThread;
#include "common/config_obs.h"
#include "common/HeartbeatMap.h"
#include "common/Thread.h"
+#include "include/common_fwd.h"
#include "include/Context.h"
#include "common/HBHandle.h"
-class CephContext;
/// Pool of threads that share work submitted to multiple work queues.
class ThreadPool : public md_config_obs_t {
using std::ostringstream;
+using namespace TOPNSPC::common;
/*
* UNIX domain sockets created by an application persist even after that
#include <thread>
#include "include/buffer.h"
+#include "include/common_fwd.h"
#include "common/ref.h"
#include "common/cmdparse.h"
class AdminSocket;
-class CephContext;
class MCommand;
class MMonCommand;
#include <boost/algorithm/string.hpp>
+#include "include/common_fwd.h"
#include "include/mempool.h"
#include "include/stringify.h"
#include "common/admin_socket.h"
#include <pthread.h>
#ifdef WITH_SEASTAR
+namespace crimson::common {
CephContext::CephContext()
: _conf{crimson::common::local_conf()},
_perf_counters_collection{crimson::common::local_perf_coll()},
return _perf_counters_collection.get_perf_collection();
}
+}
#else // WITH_SEASTAR
namespace {
} // anonymous namespace
+namespace ceph::common {
class CephContextServiceThread : public Thread
{
public:
bool _exit_thread;
CephContext *_cct;
};
-
+}
/**
* observe logging config changes
};
+namespace ceph::common {
// cct config watcher
class CephContextObs : public md_config_obs_t {
CephContext *cct;
}
}
};
+// perfcounter hooks
+
+class CephContextHook : public AdminSocketHook {
+ CephContext *m_cct;
+
+public:
+ explicit CephContextHook(CephContext *cct) : m_cct(cct) {}
+
+ int call(std::string_view command, const cmdmap_t& cmdmap,
+ Formatter *f,
+ std::ostream& errss,
+ bufferlist& out) override {
+ try {
+ return m_cct->do_command(command, cmdmap, f, errss, &out);
+ } catch (const bad_cmd_get& e) {
+ return -EINVAL;
+ }
+ }
+};
+
bool CephContext::check_experimental_feature_enabled(const std::string& feat)
{
return enabled;
}
-// perfcounter hooks
-
-class CephContextHook : public AdminSocketHook {
- CephContext *m_cct;
-
-public:
- explicit CephContextHook(CephContext *cct) : m_cct(cct) {}
-
- int call(std::string_view command, const cmdmap_t& cmdmap,
- Formatter *f,
- std::ostream& errss,
- bufferlist& out) override {
- try {
- return m_cct->do_command(command, cmdmap, f, errss, &out);
- } catch (const bad_cmd_get& e) {
- return -EINVAL;
- }
- }
-};
-
int CephContext::do_command(std::string_view command, const cmdmap_t& cmdmap,
Formatter *f,
std::ostream& ss,
void CephContext::init_crypto()
{
if (_crypto_inited++ == 0) {
- ceph::crypto::init();
+ TOPNSPC::crypto::init();
}
}
void CephContext::shutdown_crypto()
{
if (--_crypto_inited == 0) {
- ceph::crypto::shutdown(g_code_env == CODE_ENVIRONMENT_LIBRARY);
+ TOPNSPC::crypto::shutdown(g_code_env == CODE_ENVIRONMENT_LIBRARY);
}
}
for (auto &&t : _fork_watchers)
t->handle_post_fork();
}
+}
#endif // WITH_SEASTAR
#include <typeinfo>
#include <typeindex>
+#include "include/common_fwd.h"
#include "include/any.h"
#include "common/cmdparse.h"
#include "crush/CrushLocation.h"
class AdminSocket;
-class CephContextServiceThread;
-class CephContextHook;
-class CephContextObs;
class CryptoHandler;
class CryptoRandom;
+namespace ceph::common {
+ class CephContextServiceThread;
+ class CephContextObs;
+ class CephContextHook;
+}
+
namespace ceph {
class PluginRegistry;
class HeartbeatMap;
}
#ifdef WITH_SEASTAR
+namespace crimson::common {
class CephContext {
public:
CephContext();
std::unique_ptr<CryptoRandom> _crypto_random;
unsigned nref;
};
+}
#else
+#ifdef __cplusplus
+namespace ceph::common {
+#endif
/* A CephContext represents the context held by a single library user.
* There can be multiple CephContexts in the same process.
*
CephContext& operator =(CephContext&&) = delete;
bool _finished = false;
+ ~CephContext();
// ref count!
private:
- ~CephContext();
std::atomic<unsigned> nref;
public:
CephContext *get() {
md_config_obs_t *_lockdep_obs;
public:
- CrushLocation crush_location;
+ TOPNSPC::crush::CrushLocation crush_location;
private:
enum {
friend class CephContextObs;
};
+#ifdef __cplusplus
+}
+#endif
#endif // WITH_SEASTAR
#endif
# include <openssl/err.h>
#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
-namespace ceph::crypto::ssl {
+namespace TOPNSPC::crypto::ssl {
#if OPENSSL_VERSION_NUMBER < 0x10100000L
static std::atomic_uint32_t crypto_refs;
OPENSSL_cleanse(s, n);
}
-} // namespace ceph::crypto::openssl
+} // namespace TOPNSPC::crypto::openssl
-void ceph::crypto::init() {
- ceph::crypto::ssl::init();
+namespace TOPNSPC::crypto {
+void init() {
+ ssl::init();
}
-void ceph::crypto::shutdown([[maybe_unused]] const bool shared) {
- ceph::crypto::ssl::shutdown();
+void shutdown([[maybe_unused]] const bool shared) {
+ ssl::shutdown();
}
-void ceph::crypto::zeroize_for_security(void* const s, const size_t n) {
- ceph::crypto::ssl::zeroize_for_security(s, n);
+void zeroize_for_security(void* const s, const size_t n) {
+ ssl::zeroize_for_security(s, n);
}
-ceph::crypto::ssl::OpenSSLDigest::OpenSSLDigest(const EVP_MD * _type)
+ssl::OpenSSLDigest::OpenSSLDigest(const EVP_MD * _type)
: mpContext(EVP_MD_CTX_create())
, mpType(_type) {
this->Restart();
}
-ceph::crypto::ssl::OpenSSLDigest::~OpenSSLDigest() {
+ssl::OpenSSLDigest::~OpenSSLDigest() {
EVP_MD_CTX_destroy(mpContext);
}
-void ceph::crypto::ssl::OpenSSLDigest::Restart() {
+void ssl::OpenSSLDigest::Restart() {
EVP_DigestInit_ex(mpContext, mpType, NULL);
}
-void ceph::crypto::ssl::OpenSSLDigest::Update(const unsigned char *input, size_t length) {
+void ssl::OpenSSLDigest::Update(const unsigned char *input, size_t length) {
if (length) {
EVP_DigestUpdate(mpContext, const_cast<void *>(reinterpret_cast<const void *>(input)), length);
}
}
-void ceph::crypto::ssl::OpenSSLDigest::Final(unsigned char *digest) {
+void ssl::OpenSSLDigest::Final(unsigned char *digest) {
unsigned int s;
EVP_DigestFinal_ex(mpContext, digest, &s);
}
+
+}
#include "acconfig.h"
#include <stdexcept>
+#include "include/common_fwd.h"
#include "include/buffer.h"
#include "include/types.h"
const EVP_MD *EVP_sha512(void);
}
-namespace ceph {
- namespace crypto {
- void assert_init();
- void init();
- void shutdown(bool shared=true);
+namespace TOPNSPC::crypto {
+ void assert_init();
+ void init();
+ void shutdown(bool shared=true);
- void zeroize_for_security(void *s, size_t n);
- }
-}
+ void zeroize_for_security(void *s, size_t n);
-namespace ceph {
- namespace crypto {
- class DigestException : public std::runtime_error
- {
+ class DigestException : public std::runtime_error
+ {
public:
DigestException(const char* what_arg) : runtime_error(what_arg)
{}
- };
+ };
- namespace ssl {
- class OpenSSLDigest {
+ namespace ssl {
+ class OpenSSLDigest {
private:
EVP_MD_CTX *mpContext;
const EVP_MD *mpType;
void Restart();
void Update (const unsigned char *input, size_t length);
void Final (unsigned char *digest);
- };
+ };
- class MD5 : public OpenSSLDigest {
+ class MD5 : public OpenSSLDigest {
public:
static constexpr size_t digest_size = CEPH_CRYPTO_MD5_DIGESTSIZE;
MD5 () : OpenSSLDigest(EVP_md5()) { }
- };
+ };
- class SHA1 : public OpenSSLDigest {
+ class SHA1 : public OpenSSLDigest {
public:
static constexpr size_t digest_size = CEPH_CRYPTO_SHA1_DIGESTSIZE;
SHA1 () : OpenSSLDigest(EVP_sha1()) { }
- };
+ };
- class SHA256 : public OpenSSLDigest {
+ class SHA256 : public OpenSSLDigest {
public:
static constexpr size_t digest_size = CEPH_CRYPTO_SHA256_DIGESTSIZE;
SHA256 () : OpenSSLDigest(EVP_sha256()) { }
- };
+ };
- class SHA512 : public OpenSSLDigest {
+ class SHA512 : public OpenSSLDigest {
public:
static constexpr size_t digest_size = CEPH_CRYPTO_SHA512_DIGESTSIZE;
SHA512 () : OpenSSLDigest(EVP_sha512()) { }
- };
- }
- }
-}
+ };
-namespace ceph::crypto::ssl {
# if OPENSSL_VERSION_NUMBER < 0x10100000L
class HMAC {
private:
: mpType(type) {
// the strict FIPS zeroization doesn't seem to be necessary here.
// just in the case.
- ::ceph::crypto::zeroize_for_security(&mContext, sizeof(mContext));
+ ::TOPNSPC::crypto::zeroize_for_security(&mContext, sizeof(mContext));
const auto r = HMAC_Init_ex(&mContext, key, length, mpType, nullptr);
if (r != 1) {
throw DigestException("HMAC_Init_ex() failed");
}
-namespace ceph {
- namespace crypto {
- using ceph::crypto::ssl::SHA256;
- using ceph::crypto::ssl::MD5;
- using ceph::crypto::ssl::SHA1;
- using ceph::crypto::ssl::SHA512;
+ using ssl::SHA256;
+ using ssl::MD5;
+ using ssl::SHA1;
+ using ssl::SHA512;
- using ceph::crypto::ssl::HMACSHA256;
- using ceph::crypto::ssl::HMACSHA1;
- }
-}
+ using ssl::HMACSHA256;
+ using ssl::HMACSHA1;
-namespace ceph::crypto {
template<class Digest>
auto digest(const ceph::buffer::list& bl)
{
*
*/
+#include "include/common_fwd.h"
#include "common/cmdparse.h"
#include "common/Formatter.h"
#include "common/debug.h"
* Given a cmddesc like "foo baz name=bar,type=CephString",
* return the prefix "foo baz".
*/
+namespace TOPNSPC::common {
std::string cmddesc_get_prefix(const std::string_view &cmddesc)
{
string tmp(cmddesc); // FIXME: stringstream ctor can't take string_view :(
return false;
}
-
+}
#include <ostream>
#include <boost/variant.hpp>
#include "include/ceph_assert.h" // boost clobbers this
+#include "include/common_fwd.h"
#include "common/Formatter.h"
#include "common/BackTrace.h"
-class CephContext;
-
typedef boost::variant<std::string,
bool,
int64_t,
std::vector<double>> cmd_vartype;
typedef std::map<std::string, cmd_vartype, std::less<>> cmdmap_t;
+namespace TOPNSPC::common {
std::string cmddesc_get_prefix(const std::string_view &cmddesc);
std::string cmddesc_get_prenautilus_compat(const std::string &cmddesc);
void dump_cmd_to_json(ceph::Formatter *f, uint64_t features,
extern int parse_osd_id(const char *s, std::ostream *pss);
extern long parse_pos_long(const char *s, std::ostream *pss = NULL);
+}
#endif
#include <deque>
+#include "include/common_fwd.h"
#include "common/code_environment.h"
-class CephContext;
-
enum common_init_flags_t {
// Set up defaults that make sense for an unprivileged daemon
CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS = 0x1,
#include "common/subsys_types.h"
#include "common/config_tracker.h"
#include "common/config_values.h"
-
-class CephContext;
+#include "include/common_fwd.h"
enum {
CONF_DEFAULT,
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
#pragma once
+#include "include/common_fwd.h"
-#ifdef WITH_SEASTAR
-namespace crimson::common {
+namespace TOPNSPC::common {
class ConfigProxy;
}
-using ConfigProxy = crimson::common::ConfigProxy;
-#else
-class ConfigProxy;
-#endif
+using TOPNSPC::common::ConfigProxy;
// @c ConfigProxy is a facade of multiple config related classes. it exposes
// the legacy settings with arrow operator, and the new-style config with its
// member methods.
+namespace ceph::common{
class ConfigProxy {
static ConfigValues get_config_values(const ConfigProxy &config_proxy) {
std::lock_guard locker(config_proxy.lock);
config.get_defaults_bl(values, bl);
}
};
+
+}
#ifndef CEPH_COMMON_FD_H
#define CEPH_COMMON_FD_H
-class CephContext;
+#include "include/common_fwd.h"
void dump_open_fds(CephContext *cct);
#ifndef CEPH_LOCKDEP_H
#define CEPH_LOCKDEP_H
-class CephContext;
-
+#include "include/common_fwd.h"
extern bool g_lockdep;
extern void lockdep_register_ceph_context(CephContext *cct);
extern int lockdep_locked(const char *n, int id, bool force_backtrace=false);
extern int lockdep_will_unlock(const char *n, int id);
extern int lockdep_dump_locks();
-
#endif
#include <pthread.h>
#include "include/ceph_assert.h"
+#include "include/common_fwd.h"
#include "ceph_time.h"
#include "likely.h"
#include "lockdep.h"
-class CephContext;
-class PerfCounters;
-
namespace ceph {
namespace mutex_debug_detail {
// Helpers for validators
#include "include/stringify.h"
+#include "include/common_fwd.h"
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
#include <regex>
#include "common/perf_counters.h"
#include "common/dout.h"
#include "common/valgrind.h"
+#include "include/common_fwd.h"
using std::ostringstream;
+namespace TOPNSPC::common {
PerfCountersCollectionImpl::PerfCountersCollectionImpl()
{
}
return ret;
}
+}
#include "common/perf_histogram.h"
#include "include/utime.h"
+#include "include/common_fwd.h"
#include "common/ceph_mutex.h"
#include "common/ceph_time.h"
-class CephContext;
-class PerfCountersBuilder;
-class PerfCounters;
+namespace TOPNSPC::common {
+ class CephContext;
+ class PerfCountersBuilder;
+ class PerfCounters;
+}
enum perfcounter_type_d : uint8_t
{
* In the future, we will probably get rid of the first/last arguments, since
* PerfCountersBuilder can deduce them itself.
*/
+namespace TOPNSPC::common {
class PerfCountersBuilder
{
public:
prio_default = prio_;
}
- PerfCounters* create_perf_counters();
+ TOPNSPC::common::PerfCounters* create_perf_counters();
private:
PerfCountersBuilder(const PerfCountersBuilder &rhs);
PerfCountersBuilder& operator=(const PerfCountersBuilder &rhs);
const char *description, const char *nick, int prio, int ty, int unit=UNIT_NONE,
std::unique_ptr<PerfHistogram<>> histogram = nullptr);
- PerfCounters *m_perf_counters;
+ TOPNSPC::common::PerfCounters *m_perf_counters;
int prio_default = 0;
};
}
};
-
+}
#endif
#include "common/ceph_mutex.h"
#include "common/ceph_context.h"
+namespace ceph::common {
/* PerfcounterCollection hold the lock for PerfCounterCollectionImp */
PerfCountersCollection::PerfCountersCollection(CephContext *cct)
: m_cct(cct),
delete p;
}
+}
#include "common/perf_counters.h"
#include "common/ceph_mutex.h"
+#include "include/common_fwd.h"
-class CephContext;
-
+namespace ceph::common {
class PerfCountersCollection
{
CephContext *m_cct;
PerfCountersDeleter(CephContext* cct) noexcept : cct(cct) {}
void operator()(PerfCounters* p) noexcept;
};
-
-using PerfCountersRef = std::unique_ptr<PerfCounters, PerfCountersDeleter>;
-
-
+}
+using PerfCountersRef = std::unique_ptr<ceph::common::PerfCounters, ceph::common::PerfCountersDeleter>;
#include <string>
#include <list>
-class CephContext;
+#include "include/common_fwd.h"
+
struct entity_addr_t;
class entity_addrvec_t;
#pragma once
#include <string>
-
-class CephContext;
+#include "include/common_fwd.h"
/* size should be the required string size + 1 */
int gen_rand_base64(CephContext *cct, char *dest, size_t size);
#include <string_view>
#include <boost/optional.hpp>
#include "include/ceph_assert.h" // boost clobbers this
+#include "include/common_fwd.h"
#include "include/buffer.h"
#include "include/int_types.h"
#ifdef HAVE_QATZIP
class Compressor;
typedef std::shared_ptr<Compressor> CompressorRef;
-class CephContext;
class Compressor {
public:
#include "crimson/common/log.h"
#include "crimson/net/Socket.h"
+using namespace crimson::common;
/**
* A Crimson-wise version of the admin socket - implementation file
*
#include "crimson/osd/osd.h"
using crimson::osd::OSD;
+using namespace crimson::common;
namespace {
seastar::logger& logger()
#include "common/perf_counters.h"
#include <seastar/core/sharded.hh>
+using crimson::common::PerfCountersCollectionImpl;
namespace crimson::common {
class PerfCountersCollection: public seastar::sharded<PerfCountersCollection>
{
const EntityName& name,
uint32_t want_keys)
{
- static CephContext cct;
+ static crimson::common::CephContext cct;
std::unique_ptr<AuthClientHandler> auth;
auth.reset(AuthClientHandler::create(&cct,
protocol,
const ceph::bufferlist& payload,
ceph::bufferlist *reply) final;
- CephContext cct; // for auth_registry
+ crimson::common::CephContext cct; // for auth_registry
AuthRegistry auth_registry;
crimson::common::AuthHandler& auth_handler;
namespace {
entity_addrvec_t pick_addresses(int what) {
entity_addrvec_t addrs;
- CephContext cct;
+ crimson::common::CephContext cct;
if (int r = ::pick_addresses(&cct, what, &addrs, -1); r < 0) {
throw std::runtime_error("failed to pick address");
}
return std::max(.00001, double(total) / double(1ull << 40)); // TB
}
}();
- const CrushLocation loc{make_unique<CephContext>().get()};
+ const crimson::crush::CrushLocation loc{make_unique<CephContext>().get()};
logger().info("{} crush location is {}", __func__, loc);
string cmd = fmt::format(R"({{
"prefix": "osd crush create-or-move",
std::ostream& gen_prefix(std::ostream& out) const final {
return out << *this;
}
- CephContext *get_cct() const final {
+ crimson::common::CephContext *get_cct() const final {
return shard_services.get_cct();
}
unsigned get_subsys() const final {
#include <boost/intrusive_ptr.hpp>
#include <seastar/core/future.hh>
+#include "include/common_fwd.h"
#include "osd_operation.h"
#include "msg/MessageRef.h"
#include "crimson/os/futurized_collection.h"
class FuturizedStore;
}
-class PerfCounters;
class OSDMap;
class PeeringCtx;
class BufferedRecoveryMessages;
crimson::mgr::Client &mgrc;
crimson::os::FuturizedStore &store;
- CephContext cct;
+ crimson::common::CephContext cct;
PerfCounters *perf = nullptr;
PerfCounters *recoverystate_perf = nullptr;
return store;
}
- CephContext *get_cct() {
+ crimson::common::CephContext *get_cct() {
return &cct;
}
#include "include/str_list.h"
#include "common/debug.h"
#include "common/errno.h"
+#include "include/common_fwd.h"
#include "include/compat.h"
#include "common/SubProcess.h"
#include <vector>
+namespace TOPNSPC::crush {
+
int CrushLocation::update_from_conf()
{
if (cct->_conf->crush_location.length())
}
return os;
}
+
+}
#include <string>
#include "common/ceph_mutex.h"
+#include "include/common_fwd.h"
-class CephContext;
+namespace TOPNSPC::crush {
class CrushLocation {
public:
};
std::ostream& operator<<(std::ostream& os, const CrushLocation& loc);
-
+}
#endif
/*
* Global variables for use from process context.
*/
+namespace TOPNSPC::global {
CephContext *g_ceph_context = NULL;
ConfigProxy& g_conf() {
#ifdef WITH_SEASTAR
g_eio_length = length;
return 0;
}
+}
#include <limits.h>
#include "common/config_fwd.h"
+#include "include/common_fwd.h"
-class CephContext;
-
+namespace TOPNSPC::global {
extern CephContext *g_ceph_context;
ConfigProxy& g_conf();
unsigned long long offset,
unsigned long long length);
+}
+using namespace TOPNSPC::global;
#endif
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_
-
static void global_init_set_globals(CephContext *cct)
{
g_ceph_context = cct;
return boost::intrusive_ptr<CephContext>{g_ceph_context, false};
}
-
+namespace TOPNSPC::common {
void intrusive_ptr_add_ref(CephContext* cct)
{
cct->get();
{
cct->put();
}
-
+}
void global_print_banner(void)
{
output_ceph_version();
#include "common/code_environment.h"
#include "common/common_init.h"
-class CephContext;
-
/*
* global_init is the first initialization function that
* daemons and utility programs need to call. It takes care of a lot of
const char *data_dir_option = 0,
bool run_pre_init = true);
-void intrusive_ptr_add_ref(CephContext* cct);
-void intrusive_ptr_release(CephContext* cct);
+namespace TOPNSPC::common {
+ void intrusive_ptr_add_ref(CephContext* cct);
+ void intrusive_ptr_release(CephContext* cct);
+}
// just the first half; enough to get config parsed but doesn't start up the
// cct or log.
* print daemon startup banner/warning
*/
void global_print_banner(void);
-
#endif
# include "acconfig.h"
#endif
-class CephContext;
+#include "include/common_fwd.h"
namespace ceph {
#include "ceph_statx.h"
#ifdef __cplusplus
+namespace ceph::common {
+ class CephContext;
+}
+using CephContext = ceph::common::CephContext;
extern "C" {
#endif
} vinodeno_t;
typedef struct Fh Fh;
+struct CephContext;
#else /* _cplusplus */
struct inodeno_t;
struct vinodeno_t;
typedef struct vinodeno_t vinodeno;
-
#endif /* ! __cplusplus */
struct UserPerm;
struct ceph_mount_info;
struct ceph_dir_result;
-struct CephContext;
/* setattr mask bits */
#ifndef CEPH_SETATTR_MODE
* @param conf reuse this pre-existing CephContext config
* @returns 0 on success, negative error code on failure
*/
+#ifdef __cplusplus
+int ceph_create_with_context(struct ceph_mount_info **cmount, CephContext *conf);
+#else
int ceph_create_with_context(struct ceph_mount_info **cmount, struct CephContext *conf);
-
+#endif
#ifndef VOIDPTR_RADOS_T
#define VOIDPTR_RADOS_T
* @param cmount the ceph mount handle to get the context from.
* @returns the CephContext associated with the mount handle.
*/
+#ifdef __cplusplus
+CephContext *ceph_get_mount_context(struct ceph_mount_info *cmount);
+#else
struct CephContext *ceph_get_mount_context(struct ceph_mount_info *cmount);
-
+#endif
/*
* Check mount status.
*
--- /dev/null
+#pragma once
+
+#ifdef WITH_SEASTAR
+#define TOPNSPC crimson
+#else
+#define TOPNSPC ceph
+#endif
+
+namespace TOPNSPC::common {
+ class CephContext;
+ class PerfCounters;
+ class PerfCountersBuilder;
+ class PerfCountersCollection;
+ class PerfCountersCollectionImpl;
+ class PerfGuard;
+ class RefCountedObject;
+ class RefCountedObjectSafe;
+ class RefCountedCond;
+ class RefCountedWaitObject;
+ class ConfigProxy;
+}
+using TOPNSPC::common::CephContext;
+using TOPNSPC::common::PerfCounters;
+using TOPNSPC::common::PerfCountersBuilder;
+using TOPNSPC::common::PerfCountersCollection;
+using TOPNSPC::common::PerfCountersCollectionImpl;
+using TOPNSPC::common::PerfGuard;
+using TOPNSPC::common::RefCountedObject;
+using TOPNSPC::common::RefCountedObjectSafe;
+using TOPNSPC::common::RefCountedCond;
+using TOPNSPC::common::RefCountedWaitObject;
+using TOPNSPC::common::ConfigProxy;
#include "common/Cond.h"
#include "common/ceph_context.h"
+#include "include/common_fwd.h"
// reinclude our assert to clobber the system one
# include "include/ceph_assert.h"
-class PerfCounters;
-
enum {
l_leveldb_first = 34300,
l_leveldb_gets,
#include <string>
#include <memory>
#include <boost/scoped_ptr.hpp>
+#include "include/common_fwd.h"
#include "include/encoding.h"
#include "include/btree_map.h"
#include "KeyValueDB.h"
using std::string;
#define KEY_DELIM '\0'
-class PerfCounters;
enum {
l_memdb_first = 34440,
using std::string;
#include "common/perf_counters.h"
#include "common/PriorityCache.h"
+#include "include/common_fwd.h"
#include "include/str_list.h"
#include "include/stringify.h"
#include "include/str_map.h"
#include "common/errno.h"
#include "common/dout.h"
#include "include/ceph_assert.h"
+#include "include/common_fwd.h"
#include "common/Formatter.h"
#include "common/Cond.h"
#include "common/ceph_context.h"
#include "common/PriorityCache.h"
-class PerfCounters;
enum {
l_rocksdb_first = 34300,
#include "common/Timer.h"
#include "common/ceph_mutex.h"
#include "common/ceph_time.h"
+#include "include/common_fwd.h"
#include "include/rados/librados.h"
#include "include/rados/librados.hpp"
#include "mon/MonClient.h"
struct AuthAuthorizer;
struct Context;
-class CephContext;
struct Connection;
class Message;
class MLog;
#ifndef __CEPH_OSDC_SNAP_SET_DIFF_H
#define __CEPH_OSDC_SNAP_SET_DIFF_H
-class CephContext;
+#include "include/common_fwd.h"
#include "include/rados/rados_types.hpp"
#include "include/interval_set.h"
#include "common/snap_types.h"
#include "common/zipkin_trace.h"
+#include "include/common_fwd.h"
#include "include/buffer_fwd.h"
#include "include/rbd/librbd.hpp"
#include "include/rbd_types.h"
#include <boost/lockfree/policies.hpp>
#include <boost/lockfree/queue.hpp>
-class CephContext;
class ContextWQ;
class Finisher;
-class PerfCounters;
class ThreadPool;
class SafeTimer;
#ifndef LIBRBD_TASK_FINISHER_H
#define LIBRBD_TASK_FINISHER_H
+#include "include/common_fwd.h"
#include "include/Context.h"
#include "common/ceph_context.h"
#include "common/Finisher.h"
#include <map>
#include <utility>
-class CephContext;
namespace librbd {
#ifndef CEPH_LIBRBD_API_CONFIG_H
#define CEPH_LIBRBD_API_CONFIG_H
+#include "common/config_fwd.h"
+#include "include/common_fwd.h"
#include "include/rbd/librbd.hpp"
#include "include/rados/librados_fwd.hpp"
-struct ConfigProxy;
-
namespace librbd {
class ImageCtx;
#ifndef CEPH_LIBRBD_IMAGE_ATTACH_CHILD_REQUEST_H
#define CEPH_LIBRBD_IMAGE_ATTACH_CHILD_REQUEST_H
+#include "include/common_fwd.h"
#include "include/int_types.h"
#include "include/rados/librados.hpp"
-class CephContext;
class Context;
namespace librbd {
#ifndef CEPH_LIBRBD_IMAGE_CLONE_REQUEST_H
#define CEPH_LIBRBD_IMAGE_CLONE_REQUEST_H
-#include "include/rbd/librbd.hpp"
#include "cls/rbd/cls_rbd_types.h"
+#include "common/config_fwd.h"
#include "librbd/internal.h"
+#include "include/rbd/librbd.hpp"
-class ConfigProxy;
class Context;
using librados::IoCtx;
#ifndef CEPH_LIBRBD_IMAGE_CREATE_REQUEST_H
#define CEPH_LIBRBD_IMAGE_CREATE_REQUEST_H
+#include "common/config_fwd.h"
#include "include/int_types.h"
#include "include/buffer.h"
#include "include/rados/librados.hpp"
#include "cls/rbd/cls_rbd_types.h"
#include "librbd/ImageCtx.h"
-class ConfigProxy;
class Context;
class ContextWQ;
#ifndef CEPH_LIBRBD_IMAGE_VALIDATE_POOL_REQUEST_H
#define CEPH_LIBRBD_IMAGE_VALIDATE_POOL_REQUEST_H
+#include "include/common_fwd.h"
#include "include/rados/librados.hpp"
#include "include/buffer.h"
-class CephContext;
class Context;
class ContextWQ;
#define CEPH_LIBRBD_IO_AIO_COMPLETION_H
#include "common/ceph_time.h"
+#include "include/common_fwd.h"
#include "include/Context.h"
#include "include/utime.h"
#include "include/rbd/librbd.hpp"
#include <condition_variable>
#include <mutex>
-class CephContext;
namespace librbd {
namespace io {
#ifndef CEPH_LIBRBD_IO_READ_RESULT_H
#define CEPH_LIBRBD_IO_READ_RESULT_H
+#include "include/common_fwd.h"
#include "include/int_types.h"
#include "include/buffer_fwd.h"
#include "include/Context.h"
#include <sys/uio.h>
#include <boost/variant/variant.hpp>
-struct CephContext;
namespace librbd {
#ifndef CEPH_LIBRBD_JOURNAL_UTILS_H
#define CEPH_LIBRBD_JOURNAL_UTILS_H
+#include "include/common_fwd.h"
#include "include/int_types.h"
#include "include/Context.h"
#include "cls/journal/cls_journal_types.h"
#include <list>
-struct CephContext;
namespace librbd {
namespace journal {
#ifndef CEPH_LIBRBD_TRASH_MOVE_REQUEST_H
#define CEPH_LIBRBD_TRASH_MOVE_REQUEST_H
+#include "include/common_fwd.h"
#include "include/utime.h"
#include "include/rados/librados.hpp"
#include "cls/rbd/cls_rbd_types.h"
#include <string>
-struct CephContext;
struct Context;
namespace librbd {
#ifndef CEPH_LIBRBD_TRASH_REMOVE_REQUEST_H
#define CEPH_LIBRBD_TRASH_REMOVE_REQUEST_H
+#include "include/common_fwd.h"
#include "include/utime.h"
#include "include/rados/librados.hpp"
#include "cls/rbd/cls_rbd_types.h"
#include <string>
-class CephContext;
class Context;
class ContextWQ;
#include "include/CompatSet.h"
#include "include/ceph_features.h"
+#include "include/common_fwd.h"
#include "common/Formatter.h"
#include "mds/mdstypes.h"
-class CephContext;
class health_check_map_t;
/**
#include <thread>
#include "common/DecayCounter.h"
+#include "include/common_fwd.h"
#include "include/types.h"
#include "include/filepath.h"
#include "include/elist.h"
#include "MDSMap.h"
#include "Mutation.h"
-class PerfCounters;
-
class MDSRank;
class Session;
class Migrator;
#ifndef CEPH_MDLOG_H
#define CEPH_MDLOG_H
+#include "include/common_fwd.h"
+
enum {
l_mdl_first = 5000,
l_mdl_evadd,
class MDSRank;
class LogSegment;
class ESubtreeMap;
-class PerfCounters;
class MDLog {
public:
#include <string_view>
#include <vector>
+#include "include/common_fwd.h"
#include "include/types.h"
#include "common/debug.h"
bool network_valid = true;
};
-class CephContext;
-
class MDSAuthCaps
{
public:
#define dout_subsys ceph_subsys_mds
#undef dout_prefix
#define dout_prefix *_dout << "mds." << name << ' '
-
+using TOPNSPC::common::cmd_getval;
// cons/des
MDSDaemon::MDSDaemon(std::string_view n, Messenger *m, MonClient *mc) :
Dispatcher(m->cct),
try {
mds_rank->handle_asok_command(command, cmdmap, f, inbl, on_finish);
return;
- } catch (const bad_cmd_get& e) {
+ } catch (const TOPNSPC::common::bad_cmd_get& e) {
ss << e.what();
r = -EINVAL;
}
r = -EINVAL;
ss << "no command given";
outs = ss.str();
- } else if (!cmdmap_from_json(m->cmd, &cmdmap, ss)) {
+ } else if (!TOPNSPC::common::cmdmap_from_json(m->cmd, &cmdmap, ss)) {
r = -EINVAL;
outs = ss.str();
} else {
#include "include/ceph_features.h"
#include "include/health.h"
#include "include/CompatSet.h"
+#include "include/common_fwd.h"
#include "common/Clock.h"
#include "common/Formatter.h"
#define MDS_FS_NAME_DEFAULT "cephfs"
-class CephContext;
class health_check_map_t;
class MDSMap {
#define dout_subsys ceph_subsys_mds
#undef dout_prefix
#define dout_prefix *_dout << "mds." << whoami << '.' << incarnation << ' '
-
+using TOPNSPC::common::cmd_getval;
class C_Flush_Journal : public MDSInternalContext {
public:
C_Flush_Journal(MDCache *mdcache, MDLog *mdlog, MDSRank *mds,
#include "common/Timer.h"
#include "common/TrackedOp.h"
+#include "include/common_fwd.h"
+
#include "messages/MClientRequest.h"
#include "messages/MCommand.h"
#include "messages/MMDSMap.h"
friend class C_ScrubExecAndReply;
friend class C_ScrubControlExecAndReply;
- class CephContext *cct;
+ CephContext *cct;
MDSRank(
mds_rank_t whoami_,
#include <set>
+#include "include/common_fwd.h"
#include "osdc/Filer.h"
class CInode;
class MDSRank;
-class PerfCounters;
class RecoveryQueue {
public:
#include <common/DecayCounter.h>
+#include "include/common_fwd.h"
+
#include "messages/MClientReconnect.h"
#include "messages/MClientReply.h"
#include "messages/MClientRequest.h"
#include "MDSContext.h"
class OSDMap;
-class PerfCounters;
class LogEvent;
class EMetaBlob;
class EUpdate;
#ifndef STRAY_MANAGER_H
#define STRAY_MANAGER_H
+#include "include/common_fwd.h"
#include "include/elist.h"
#include <list>
#include "mds/PurgeQueue.h"
class MDSRank;
-class PerfCounters;
class CInode;
class CDentry;
#include "mgr/OSDPerfMetricTypes.h"
#include "common/perf_counters.h"
+#include "include/common_fwd.h"
#include "mgr/DaemonHealthMetric.h"
class PerfCounterType
Gil gil(py_module->pMyThreadState, true);
PyFormatter f;
- cmdmap_dump(cmdmap, &f);
+ TOPNSPC::common::cmdmap_dump(cmdmap, &f);
PyObject *py_cmd = f.get();
string instr;
inbuf.begin().copy(inbuf.length(), instr);
try {
r = cluster_state->asok_command(admin_command, cmdmap, f, outss);
out.append(outss);
- } catch (const bad_cmd_get& e) {
+ } catch (const TOPNSPC::common::bad_cmd_get& e) {
errss << e.what();
r = -EINVAL;
}
if (admin_command == "dump_osd_network") {
int64_t value = 0;
// Default to health warning level if nothing specified
- if (!(cmd_getval(cmdmap, "value", value))) {
+ if (!(TOPNSPC::common::cmd_getval(cmdmap, "value", value))) {
// Convert milliseconds to microseconds
value = static_cast<int64_t>(g_ceph_context->_conf.get_val<double>("mon_warn_on_slow_ping_time")) * 1000;
if (value == 0) {
#define dout_subsys ceph_subsys_mgr
#undef dout_prefix
#define dout_prefix *_dout << "mgr.server " << __func__ << " "
-
+using namespace TOPNSPC::common;
namespace {
template <typename Map>
bool map_compare(Map const &lhs, Map const &rhs) {
#define dout_subsys ceph_subsys_mon
#undef dout_prefix
#define dout_prefix _prefix(_dout, mon, get_last_committed())
+using namespace TOPNSPC::common;
static ostream& _prefix(std::ostream *_dout, Monitor *mon, version_t v) {
return *_dout << "mon." << mon->name << "@" << mon->rank
<< "(" << mon->get_state_name()
#define dout_subsys ceph_subsys_mon
#undef dout_prefix
#define dout_prefix _prefix(_dout, mon, this)
+using namespace TOPNSPC::common;
static ostream& _prefix(std::ostream *_dout, const Monitor *mon,
const ConfigKeyService *service) {
return *_dout << "mon." << mon->name << "@" << mon->rank
string prefix;
cmdmap_t cmdmap;
- if (!cmdmap_from_json(cmd->cmd, &cmdmap, ss)) {
+ if (!TOPNSPC::common::cmdmap_from_json(cmd->cmd, &cmdmap, ss)) {
return false;
}
#define dout_subsys ceph_subsys_mon
#undef dout_prefix
#define dout_prefix _prefix(_dout, mon, this)
+using namespace TOPNSPC::common;
static ostream& _prefix(std::ostream *_dout, const Monitor *mon,
const ConfigMonitor *hmon) {
return *_dout << "mon." << mon->name << "@" << mon->rank
#include "MDSMonitor.h"
#include "MgrStatMonitor.h"
+using TOPNSPC::common::cmd_getval;
static const string EXPERIMENTAL_WARNING("Warning! This feature is experimental."
"It may cause problems up to and including data loss."
#include <regex>
#include "include/ceph_assert.h"
+#include "include/common_fwd.h"
#include "include/stringify.h"
#include "mon/Monitor.h"
#define dout_subsys ceph_subsys_mon
#undef dout_prefix
#define dout_prefix _prefix(_dout, mon, this)
+using namespace TOPNSPC::common;
static ostream& _prefix(std::ostream *_dout, const Monitor *mon,
const HealthMonitor *hmon) {
return *_dout << "mon." << mon->name << "@" << mon->rank
#define dout_subsys ceph_subsys_mon
+using namespace TOPNSPC::common;
+
string LogMonitor::log_channel_info::get_log_file(const string &channel)
{
dout(25) << __func__ << " for channel '"
#define dout_subsys ceph_subsys_mon
#undef dout_prefix
#define dout_prefix _prefix(_dout, mon, get_fsmap())
+using namespace TOPNSPC::common;
+
static ostream& _prefix(std::ostream *_dout, Monitor *mon, const FSMap& fsmap) {
return *_dout << "mon." << mon->name << "@" << mon->rank
<< "(" << mon->get_state_name()
* Specialized implementation of cmd_getval to allow us to parse
* out strongly-typedef'd types
*/
+namespace TOPNSPC::common {
template<> bool cmd_getval(const cmdmap_t& cmdmap,
const std::string& k, mds_gid_t &val)
{
{
return cmd_getval(cmdmap, k, (int64_t&)val);
}
-
+}
// my methods
template <int dblV>
#define dout_subsys ceph_subsys_mon
#undef dout_prefix
#define dout_prefix _prefix(_dout, mon, map)
+using namespace TOPNSPC::common;
static ostream& _prefix(std::ostream *_dout, Monitor *mon,
const MgrMap& mgrmap) {
return *_dout << "mon." << mon->name << "@" << mon->rank
#include <ostream>
+#include "include/common_fwd.h"
#include "include/types.h"
#include "common/entity_name.h"
-class CephContext;
-
static const __u8 MON_CAP_R = (1 << 1); // read
static const __u8 MON_CAP_W = (1 << 2); // write
static const __u8 MON_CAP_X = (1 << 3); // execute
#define dout_subsys ceph_subsys_mon
#undef dout_prefix
#define dout_prefix _prefix(_dout, this)
+using namespace TOPNSPC::common;
static ostream& _prefix(std::ostream *_dout, const Monitor *mon) {
return *_dout << "mon." << mon->name << "@" << mon->rank
<< "(" << mon->get_state_name() << ") e" << mon->monmap->get_epoch() << " ";
#include "auth/cephx/CephxKeyServer.h"
#include "auth/AuthMethodList.h"
#include "auth/KeyRing.h"
+#include "include/common_fwd.h"
#include "messages/MMonCommand.h"
#include "mon/MonitorDBStore.h"
#include "mgr/MgrClient.h"
class QuorumService;
class PaxosService;
-class PerfCounters;
class AdminSocketHook;
#define COMPAT_SET_LOC "feature_set"
#define dout_subsys ceph_subsys_mon
#undef dout_prefix
#define dout_prefix _prefix(_dout, mon)
+using namespace TOPNSPC::common;
static ostream& _prefix(std::ostream *_dout, Monitor *mon) {
return *_dout << "mon." << mon->name << "@" << mon->rank
<< "(" << mon->get_state_name()
-> map<int64_t,interval_set<snapid_t>>
*/
-
+using namespace TOPNSPC::common;
namespace {
struct OSDMemCache : public PriorityCache::PriCache {
using std::vector;
using ceph::bufferlist;
+using TOPNSPC::common::cmd_getval;
MEMPOOL_DEFINE_OBJECT_FACTORY(PGMapDigest, pgmap_digest, pgmap);
MEMPOOL_DEFINE_OBJECT_FACTORY(PGMap, pgmap, pgmap);
#include <queue>
#include <boost/intrusive_ptr.hpp>
#include "include/ceph_assert.h"
+#include "include/common_fwd.h"
#include "common/Throttle.h"
#include "common/ceph_mutex.h"
#include "common/Thread.h"
#include "Message.h"
-class CephContext;
class Messenger;
struct Connection;
#include <memory>
#include "include/buffer_fwd.h"
#include "include/ceph_assert.h"
+#include "include/common_fwd.h"
#include "msg/MessageRef.h"
class Messenger;
class Connection;
class CryptoKey;
-class CephContext;
class KeyStore;
class Dispatcher {
#include <string>
#include <vector>
+#include "include/common_fwd.h"
#include "include/int_types.h"
#include "include/page.h"
#include "include/scope_guard.h"
} __attribute__((packed));
class RDMAStack;
-class CephContext;
class Port {
struct ibv_context* ctxt;
#ifndef CEPH_OBJECTSTORE_H
#define CEPH_OBJECTSTORE_H
+#include "include/common_fwd.h"
#include "include/Context.h"
#include "include/buffer.h"
#include "include/types.h"
#include <sys/vfs.h> /* or <sys/statfs.h> */
#endif
-class CephContext;
-
namespace ceph {
class Formatter;
}
#include "acconfig.h"
#include "common/ceph_mutex.h"
+#include "include/common_fwd.h"
#if defined(HAVE_LIBAIO) || defined(HAVE_POSIXAIO)
#include "ceph_aio.h"
#define WRITE_LIFE_MAX 1
#endif
-class CephContext;
/// track in-flight io
struct IOContext {
#define dout_subsys ceph_subsys_bluefs
#undef dout_prefix
#define dout_prefix *_dout << "bluefs "
-
+using TOPNSPC::common::cmd_getval;
MEMPOOL_DEFINE_OBJECT_FACTORY(BlueFS::File, bluefs_file, bluefs);
MEMPOOL_DEFINE_OBJECT_FACTORY(BlueFS::Dir, bluefs_dir, bluefs);
MEMPOOL_DEFINE_OBJECT_FACTORY(BlueFS::FileWriter, bluefs_file_writer, bluefs);
#include "common/RefCountedObj.h"
#include "common/ceph_context.h"
#include "global/global_context.h"
+#include "include/common_fwd.h"
#include "boost/intrusive/list.hpp"
#include "boost/dynamic_bitset.hpp"
-class PerfCounters;
-
class Allocator;
enum {
#include <errno.h>
#include "include/buffer_fwd.h"
+#include "include/common_fwd.h"
#include "include/Context.h"
#include "common/Finisher.h"
#include "common/TrackedOp.h"
#include "os/ObjectStore.h"
#include "common/zipkin_trace.h"
-class PerfCounters;
class Journal {
protected:
#include "common/Formatter.h"
#include "common/hobject.h"
#include "include/interval_set.h"
+#include "include/common_fwd.h"
#include "FDCache.h"
#include "common/Thread.h"
#include "common/ceph_context.h"
-class PerfCounters;
enum {
l_wbthrottle_first = 999090,
l_wbthrottle_bytes_dirtied,
#include <variant>
#include "include/types.h"
+#include "include/common_fwd.h"
#include "common/ceph_mutex.h"
#include "objclass/objclass.h"
//forward declaration
-class CephContext;
-
class ClassHandler
{
public:
CephContext *cct;
-
struct ClassData;
struct ClassMethod {
#define dout_prefix _prefix(_dout, whoami, get_osdmap_epoch())
using namespace ceph::osd::scheduler;
+using TOPNSPC::common::cmd_getval;
static ostream& _prefix(std::ostream* _dout, int whoami, epoch_t epoch) {
return *_dout << "osd." << whoami << " " << epoch << " ";
std::function<void(int,const std::string&,bufferlist&)> on_finish) override {
try {
osd->asok_command(prefix, cmdmap, f, inbl, on_finish);
- } catch (const bad_cmd_get& e) {
+ } catch (const TOPNSPC::common::bad_cmd_get& e) {
bufferlist empty;
on_finish(-EINVAL, e.what(), empty);
}
pg->do_command(prefix, new_cmdmap, inbl, on_finish);
pg->unlock();
return; // the pg handler calls on_finish directly
- } catch (const bad_cmd_get& e) {
+ } catch (const TOPNSPC::common::bad_cmd_get& e) {
pg->unlock();
ss << e.what();
ret = -EINVAL;
try {
test_ops(service, store, command, cmdmap, outss);
out.append(outss);
- } catch (const bad_cmd_get& e) {
+ } catch (const TOPNSPC::common::bad_cmd_get& e) {
errss << e.what();
r = -EINVAL;
}
#include "osd/ClassHandler.h"
#include "include/CompatSet.h"
+#include "include/common_fwd.h"
#include "OpRequest.h"
#include "Session.h"
class Messenger;
class Message;
class MonClient;
-class PerfCounters;
class ObjectStore;
class FuseStore;
class OSDMap;
struct C_FinishSplits;
struct C_OpenPGs;
class LogChannel;
-class CephContext;
class MOSDOp;
class MOSDPGCreate2;
#include "common/Formatter.h"
#include "common/TextTable.h"
#include "include/ceph_features.h"
+#include "include/common_fwd.h"
#include "include/str_map.h"
#include "common/code_environment.h"
get_all_osds(*out);
break;
}
- long osd = parse_osd_id(i->c_str(), ss);
+ long osd = TOPNSPC::common::parse_osd_id(i->c_str(), ss);
if (osd < 0) {
*ss << "invalid osd id '" << *i << "'";
return -EINVAL;
#include <boost/smart_ptr/local_shared_ptr.hpp>
#include "include/btree_map.h"
+#include "include/common_fwd.h"
#include "include/types.h"
#include "common/ceph_releases.h"
#include "osd_types.h"
#include "crush/CrushWrapper.h"
// forward declaration
-class CephContext;
class CrushWrapper;
class health_check_map_t;
// re-include our assert to clobber boost's
#include "include/ceph_assert.h"
+#include "include/common_fwd.h"
#include "include/types.h"
#include "include/stringify.h"
struct OpRequest;
typedef OpRequest::Ref OpRequestRef;
class MOSDPGLog;
-class CephContext;
class DynamicPerfStats;
namespace Scrub {
// re-include our assert to clobber boost's
#include "include/ceph_assert.h"
+#include "include/common_fwd.h"
#include "osd_types.h"
#include "os/ObjectStore.h"
#include <list>
| PGLOG_INDEXED_EXTRA_CALLER_OPS
| PGLOG_INDEXED_DUPS;
-class CephContext;
-
struct PGLog : DoutPrefixProvider {
std::ostream& gen_prefix(std::ostream& out) const override {
return out;
#include <atomic>
#include "include/ceph_assert.h"
+#include "include/common_fwd.h"
#include "PGLog.h"
#include "PGStateUtils.h"
#define DOUT_PREFIX_ARGS this, osd->whoami, get_osdmap()
#undef dout_prefix
#define dout_prefix _prefix(_dout, this)
+using TOPNSPC::common::cmd_getval;
+
template <typename T>
static ostream& _prefix(std::ostream *_dout, T *pg) {
return pg->gen_prefix(*_dout);
// vim: ts=8 sw=2 smarttab
#include "osd_perf_counters.h"
+#include "include/common_fwd.h"
+
PerfCounters *build_osd_logger(CephContext *cct) {
PerfCountersBuilder osd_plb(cct, "osd", l_osd_first, l_osd_last);
#pragma once
+#include "include/common_fwd.h"
#include "common/perf_counters.h"
enum {
#include "common/Timer.h"
#include "common/Throttle.h"
+#include "include/common_fwd.h"
-class CephContext;
class Context;
-class PerfCounters;
class Finisher;
class C_OnFinisher;
#include "include/lru.h"
#include "include/Context.h"
#include "include/xlist.h"
+#include "include/common_fwd.h"
#include "common/Cond.h"
#include "common/Finisher.h"
#include "Objecter.h"
#include "Striper.h"
-class CephContext;
class WritebackHandler;
-class PerfCounters;
enum {
l_objectcacher_first = 25000,
#include <boost/thread/shared_mutex.hpp>
#include "include/ceph_assert.h"
+#include "include/common_fwd.h"
#include "include/buffer.h"
#include "include/types.h"
#include "include/rados/rados_types.hpp"
class MCommandReply;
class MWatchNotify;
-class PerfCounters;
// -----------------------------------------
#ifndef CEPH_STRIPER_H
#define CEPH_STRIPER_H
+#include "include/common_fwd.h"
#include "include/types.h"
#include "osd/osd_types.h"
#include "osdc/StriperTypes.h"
-class CephContext;
//namespace ceph {
#include <functional>
#include <boost/smart_ptr/intrusive_ptr.hpp>
-class CephContext;
+#include "include/common_fwd.h"
namespace rgw::amqp {
// forward declaration of connection object
#include "services/svc_sync_modules.h"
#include "services/svc_datalog_rados.h"
+#include "include/common_fwd.h"
#include "include/random.h"
#include <boost/asio/yield.hpp>
bool *truncated;
read_remote_data_log_response response;
- std::optional<PerfGuard> timer;
+ std::optional<TOPNSPC::common::PerfGuard> timer;
public:
RGWReadRemoteDataLogShardCR(RGWDataSyncCtx *_sc, int _shard_id,
#include <boost/smart_ptr/intrusive_ptr.hpp>
#include <boost/optional.hpp>
-class CephContext;
+#include "include/common_fwd.h"
namespace rgw::kafka {
// forward declaration of connection object
#include <string>
#include "common/ceph_time.h"
+#include "include/common_fwd.h"
#include "rgw_notify_event_type.h"
// forward declarations
-class CephContext;
namespace rgw::sal {
class RGWRadosStore;
}
#include "global/global_init.h"
+#include "include/common_fwd.h"
#include "include/utime.h"
#include "include/str_list.h"
#include "rgw_sal.h"
-class CephContext;
class RGWSI_RADOS;
class RGWSI_Zone;
class RGWBucketInfo;
// vim: ts=8 sw=2 smarttab ft=cpp
#pragma once
-
-class CephContext;
-class PerfCounters;
+#include "include/common_fwd.h"
extern PerfCounters *perfcounter;
#define CEPH_RGW_PERIOD_PULLER_H
#include "rgw_period_history.h"
+#include "include/common_fwd.h"
-class CephContext;
class RGWPeriod;
class RGWPeriodPuller : public RGWPeriodHistory::Puller {
#include <memory>
#include <stdexcept>
#include "include/buffer_fwd.h"
+#include "include/common_fwd.h"
#include "common/async/yield_context.h"
// TODO the env should be used as a template parameter to differentiate the source that triggers the pushes
class RGWDataSyncEnv;
class RGWCoroutine;
class RGWHTTPArgs;
-class CephContext;
struct rgw_pubsub_event;
struct rgw_pubsub_s3_record;
#include <boost/intrusive/list.hpp>
#include <boost/asio/basic_waitable_timer.hpp>
+#include "include/common_fwd.h"
#include "include/rados/librados.hpp"
#include "common/ceph_time.h"
#include "common/async/yield_context.h"
#include "rgw_common.h"
-class CephContext;
class RGWReshard;
namespace rgw { namespace sal {
class RGWRadosStore;
#include "rgw_rest_client.h"
#include "common/ceph_json.h"
#include "common/RefCountedObj.h"
+#include "include/common_fwd.h"
#include <atomic>
-class CephContext;
class RGWSI_Zone;
template <class T>
#include <memory>
#include <boost/utility/string_view.hpp>
+#include "include/common_fwd.h"
#include "include/encoding.h"
#include "common/ceph_time.h"
-class CephContext;
class RGWCoroutine;
class RGWHTTPManager;
#include "common/Thread.h"
#include "common/ceph_mutex.h"
+#include "include/common_fwd.h"
-class CephContext;
class RGWRados;
class RGWRadosThread {
std::ostream& ss,
bufferlist& result) override {
std::vector<std::string> args;
- cmd_getval(cmdmap, "args", args);
+ TOPNSPC::common::cmd_getval(cmdmap, "args", args);
result.append(command);
result.append("|");
string resultstr;
std::ostream& ss,
bufferlist& result) override {
std::vector<std::string> args;
- cmd_getval(cmdmap, "args", args);
+ TOPNSPC::common::cmd_getval(cmdmap, "args", args);
result.append(command);
result.append("|");
string resultstr;
#ifndef LIBRADOS_MOCK_TEST_MEM_CLUSTER_H
#define LIBRADOS_MOCK_TEST_MEM_CLUSTER_H
+#include "include/common_fwd.h"
#include "test/librados_test_stub/TestMemCluster.h"
#include "test/librados_test_stub/MockTestMemRadosClient.h"
#include "gmock/gmock.h"
-struct CephContext;
namespace librados {
#define CEPH_TEST_CLUSTER_H
#include "test/librados_test_stub/TestWatchNotify.h"
-
-class CephContext;
+#include "include/common_fwd.h"
namespace librados {
#define CEPH_RBD_MIRROR_SERVICE_DAEMON_H
#include "common/ceph_mutex.h"
+#include "include/common_fwd.h"
#include "tools/rbd_mirror/Types.h"
#include "tools/rbd_mirror/service_daemon/Types.h"
#include <map>
#include <string>
-struct CephContext;
struct Context;
namespace librbd { struct ImageCtx; }
#ifndef CEPH_RBD_MIRROR_THREADS_H
#define CEPH_RBD_MIRROR_THREADS_H
+#include "include/common_fwd.h"
#include "common/ceph_mutex.h"
-class CephContext;
class ContextWQ;
class SafeTimer;
class ThreadPool;
#include "common/ceph_mutex.h"
#include "common/config_obs.h"
+#include "include/common_fwd.h"
-class CephContext;
class Context;
namespace ceph { class Formatter; }