]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
debug.h: move Ceph version stuff into version.h
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 18 Feb 2011 21:04:51 +0000 (13:04 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 18 Feb 2011 14:25:06 +0000 (06:25 -0800)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/Makefile.am
src/common/debug.cc
src/common/debug.h
src/common/version.cc [new file with mode: 0644]
src/common/version.h [new file with mode: 0644]
src/config.cc

index ab3ac6ebaa1212c039622917a5ca3709e498b268..38346380360eec5b20900ff15bbfcdfd21014100 100644 (file)
@@ -534,7 +534,8 @@ libcommon_files = \
        common/page.cc \
        common/lockdep.cc \
        common/DoutStreambuf.cc \
-       common/debug.cc
+       common/debug.cc \
+       common/version.cc
 
 libcrush_a_SOURCES = \
        crush/builder.c \
@@ -653,6 +654,7 @@ noinst_HEADERS = \
        common/LogEntry.h\
        common/WorkQueue.h\
        common/debug.h\
+       common/version.h\
        common/errno.h\
        common/likely.h\
        common/lockdep.h\
index 0f433a7ea399fd5a94f3968b14a25c645161aa25..7bf1049f94bd7f5fff4d4bfee48910ff9e330e3e 100644 (file)
@@ -19,22 +19,6 @@ bool _dout_need_open = true;
  */
 pthread_mutex_t _dout_lock = PTHREAD_MUTEX_INITIALIZER;
 
-#define _STR(x) #x
-#define STRINGIFY(x) _STR(x)
-
-std::string ceph_version_to_string(void)
-{
-  std::ostringstream oss;
-  oss << "ceph version " << VERSION << " (commit:"
-      << STRINGIFY(CEPH_GIT_VER) << ")";
-  return oss.str();
-}
-
-void dout_output_ceph_version(void)
-{
-  generic_dout(-1) << ceph_version_to_string() << dendl;
-}
-
 void _dout_open_log()
 {
   // should hold _dout_lock here
index d0a981326ef81477361cc47ace26e750b79b8875..f7a2c0ba3eaf3b795738fd03999c146fbdbec993 100644 (file)
@@ -29,10 +29,6 @@ extern DoutStreambuf <char> *_doss;
 extern bool _dout_need_open;
 extern pthread_mutex_t _dout_lock;
 
-extern std::string ceph_version_to_string(void);
-
-extern void dout_output_ceph_version(void);
-
 extern void _dout_open_log();
 
 extern int dout_handle_daemonize();
diff --git a/src/common/version.cc b/src/common/version.cc
new file mode 100644 (file)
index 0000000..8d0c5d5
--- /dev/null
@@ -0,0 +1,37 @@
+// -*- 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 "config.h"
+#include "ceph_ver.h"
+#include "common/debug.h"
+#include "common/version.h"
+
+#include <sstream>
+#include <string>
+
+#define _STR(x) #x
+#define STRINGIFY(x) _STR(x)
+
+std::string ceph_version_to_string(void)
+{
+  std::ostringstream oss;
+  oss << "ceph version " << VERSION << " (commit:"
+      << STRINGIFY(CEPH_GIT_VER) << ")";
+  return oss.str();
+}
+
+void dout_output_ceph_version(void)
+{
+  generic_dout(-1) << ceph_version_to_string() << dendl;
+}
diff --git a/src/common/version.h b/src/common/version.h
new file mode 100644 (file)
index 0000000..e98e7cc
--- /dev/null
@@ -0,0 +1,24 @@
+// -*- 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_COMMON_VERSION_H
+#define CEPH_COMMON_VERSION_H
+
+// Return a string describing the Ceph version
+std::string ceph_version_to_string(void);
+
+// Output Ceph version to dout with prio -1
+void dout_output_ceph_version(void);
+
+#endif
index ca802911b11fc6a088bcea1e1eb3756257e9eef9..3c7b3c96a5808a67a9be3192b4efec325a2716de 100644 (file)
@@ -20,6 +20,7 @@
 #include "common/ProfLogger.h"
 #include "common/common_init.h"
 #include "common/dyn_snprintf.h"
+#include "common/version.h"
 #include "config.h"
 #include "include/atomic.h"
 #include "include/str_list.h"