]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: drop version from ceph_fs.h, use autoconf VERSION macro instead
authorSage Weil <sage@newdream.net>
Wed, 7 Jul 2010 15:24:13 +0000 (08:24 -0700)
committerSage Weil <sage@newdream.net>
Wed, 7 Jul 2010 15:24:13 +0000 (08:24 -0700)
There's no reason to define this in the code anymore.  Since the kernel
side doesn't use it it just confuses matters.

Signed-off-by: Sage Weil <sage@newdream.net>
src/include/ceph_fs.h
src/libceph.cc

index 25dcf15817d8b77e8ebc760f6c8d5d3dadfa20d6..bf7dea673237c1c02168b833004678aaa45d663f 100644 (file)
 #include "msgr.h"
 #include "rados.h"
 
-/*
- * Ceph release version
- */
-#define CEPH_VERSION_MAJOR 0
-#define CEPH_VERSION_MINOR 20
-#define CEPH_VERSION_PATCH 0
-
-#define CEPH_STRINGIFY_(x) #x
-#define CEPH_STRINGIFY(x) CEPH_STRINGIFY_(x)
-#define CEPH_MAKE_VERSION(x, y, z) CEPH_STRINGIFY(x) "." CEPH_STRINGIFY(y) \
-       "." CEPH_STRINGIFY(z)
-#define CEPH_VERSION CEPH_MAKE_VERSION(CEPH_VERSION_MAJOR, \
-                                      CEPH_VERSION_MINOR, CEPH_VERSION_PATCH)
-
 /*
  * subprotocol versions.  when specific messages types or high-level
  * protocols change, bump the affected components.  we keep rev
index a67dfb49c370966f8098a6384c8b9a77425cec8d..b308807a31c7b6a0158f73d35979d734a022ee02 100644 (file)
  * C interface
  */
 
-extern "C" const char *ceph_version(int *major, int *minor, int *patch)
-{
-  if (major)
-    *major = CEPH_VERSION_MAJOR;
-  if (minor)
-    *minor = CEPH_VERSION_MINOR;
-  if (patch)
-    *patch = CEPH_VERSION_PATCH;
-  return CEPH_VERSION;
+extern "C" const char *ceph_version(int *pmajor, int *pminor, int *ppatch)
+{
+  int major, minor, patch;
+
+  sscanf(VERSION, "%d.%d.%d", &major, &minor, &patch);
+  if (pmajor)
+    *pmajor = major;
+  if (pminor)
+    *pminor = minor;
+  if (ppatch)
+    *ppatch = patch;
+  return VERSION;
 }
 
 static Mutex ceph_client_mutex("ceph_client");