mirror of
https://github.com/ceph/ceph
synced 2025-02-19 17:08:05 +00:00
Create global_context.cc to house g_ceph_context
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
This commit is contained in:
parent
6ff09ef541
commit
fc43438601
@ -644,6 +644,7 @@ libcommon_files = \
|
||||
mds/MDSMap.cc \
|
||||
common/common_init.cc \
|
||||
global/global_init.cc \
|
||||
global/global_context.cc \
|
||||
common/ceph_argparse.cc \
|
||||
common/ceph_context.cc \
|
||||
common/buffer.cc \
|
||||
@ -818,6 +819,7 @@ noinst_HEADERS = \
|
||||
common/arch.h\
|
||||
common/armor.h\
|
||||
global/global_init.h \
|
||||
global/global_context.h \
|
||||
common/common_init.h\
|
||||
common/code_environment.h \
|
||||
common/signal.h\
|
||||
|
@ -23,12 +23,6 @@
|
||||
#include <pthread.h>
|
||||
#include <semaphore.h>
|
||||
|
||||
// FIXME
|
||||
// These variables are here temporarily to make the transition easier.
|
||||
CephContext g_ceph_context __attribute__((init_priority(103))) (0);
|
||||
md_config_t *g_conf(g_ceph_context._conf);
|
||||
DoutStreambuf <char, std::basic_string<char>::traits_type> *_doss(g_ceph_context._doss);
|
||||
|
||||
class CephContextServiceThread : public Thread
|
||||
{
|
||||
public:
|
||||
|
@ -16,7 +16,7 @@
|
||||
#ifndef CEPH_DOUT_H
|
||||
#define CEPH_DOUT_H
|
||||
|
||||
#include "common/ceph_context.h"
|
||||
#include "global/global_context.h"
|
||||
#include "common/DoutStreambuf.h"
|
||||
#include "common/likely.h"
|
||||
#include "common/config.h" // need for g_conf
|
||||
|
23
src/global/global_context.cc
Normal file
23
src/global/global_context.cc
Normal file
@ -0,0 +1,23 @@
|
||||
// -*- 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) 2011 New Dream Network
|
||||
*
|
||||
* 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 "common/ceph_context.h"
|
||||
#include "global/global_context.h"
|
||||
|
||||
/*
|
||||
* Global variables for use from process context.
|
||||
*/
|
||||
CephContext g_ceph_context __attribute__((init_priority(103))) (0);
|
||||
md_config_t *g_conf(g_ceph_context._conf);
|
||||
DoutStreambuf <char, std::basic_string<char>::traits_type> *_doss(g_ceph_context._doss);
|
33
src/global/global_context.h
Normal file
33
src/global/global_context.h
Normal file
@ -0,0 +1,33 @@
|
||||
// -*- 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) 2011 New Dream Network
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CEPH_GLOBAL_CONTEXT_H
|
||||
#define CEPH_GLOBAL_CONTEXT_H
|
||||
|
||||
#include "common/ceph_context.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <stdint.h>
|
||||
|
||||
/* Forward declarations */
|
||||
template <typename T, typename U>
|
||||
class DoutStreambuf;
|
||||
|
||||
class md_config_t;
|
||||
|
||||
extern CephContext g_ceph_context;
|
||||
extern md_config_t *g_conf;
|
||||
extern DoutStreambuf <char, std::basic_string<char>::traits_type> *_doss;
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user