]>
git.proxmox.com Git - ceph.git/blob - ceph/src/global/global_context.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2011 New Dream Network
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.
15 #include "common/ceph_context.h"
16 #include "global/global_context.h"
22 * Global variables for use from process context.
24 CephContext
*g_ceph_context
= NULL
;
25 ConfigProxy
& g_conf() {
27 return ceph::common::local_conf();
29 return g_ceph_context
->_conf
;
33 const char *g_assert_file
= 0;
34 int g_assert_line
= 0;
35 const char *g_assert_func
= 0;
36 const char *g_assert_condition
= 0;
37 unsigned long long g_assert_thread
= 0;
38 char g_assert_thread_name
[4096] = { 0 };
39 char g_assert_msg
[8096] = { 0 };
40 char g_process_name
[NAME_MAX
+ 1] = { 0 };
43 char g_eio_devname
[1024] = { 0 };
44 char g_eio_path
[PATH_MAX
] = { 0 };
45 int g_eio_error
= 0; // usually -EIO...
46 int g_eio_iotype
= 0; // 1 = read, 2 = write
47 unsigned long long g_eio_offset
= 0;
48 unsigned long long g_eio_length
= 0;
50 int note_io_error_event(
55 unsigned long long offset
,
56 unsigned long long length
)
60 strncpy(g_eio_devname
, devname
, sizeof(g_eio_devname
));
63 strncpy(g_eio_path
, path
, sizeof(g_eio_path
));
66 g_eio_iotype
= iotype
;
67 g_eio_offset
= offset
;
68 g_eio_length
= length
;