Create global_context.cc to house g_ceph_context

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
This commit is contained in:
Colin Patrick McCabe 2011-06-17 10:51:45 -07:00
parent 6ff09ef541
commit fc43438601
5 changed files with 59 additions and 7 deletions

View File

@ -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\

View File

@ -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:

View File

@ -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

View 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);

View 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