]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: add ceph_string.h
authorKefu Chai <kchai@redhat.com>
Mon, 29 Apr 2019 09:00:32 +0000 (17:00 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 4 May 2019 06:51:27 +0000 (02:51 -0400)
declare ceph_string functions in a single place, so their
implementation and consume can reference a single copy of declaration.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/ceph_strings.cc
src/common/ceph_strings.h [new file with mode: 0644]
src/common/entity_name.cc
src/include/rados.h

index 8711672689e8ed885f273437cd06c0af93ceaf5e..515b986dc60f2d8aeaf19477544ab4e47eb19a85 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Ceph string constants
  */
+#include "ceph_strings.h"
 #include "include/types.h"
 #include "include/ceph_features.h"
 
diff --git a/src/common/ceph_strings.h b/src/common/ceph_strings.h
new file mode 100644 (file)
index 0000000..80e2875
--- /dev/null
@@ -0,0 +1,26 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#pragma once
+
+#include <cstdint>
+
+const char *ceph_entity_type_name(int type);
+const char *ceph_con_mode_name(int con_mode);
+const char *ceph_osd_op_name(int op);
+const char *ceph_osd_state_name(int s);
+const char *ceph_release_name(int r);
+std::uint64_t ceph_release_features(int r);
+int ceph_release_from_features(std::uint64_t features);
+int ceph_release_from_name(const char *s);
+const char *ceph_osd_watch_op_name(int o);
+const char *ceph_osd_alloc_hint_flag_name(int f);
+const char *ceph_mds_state_name(int s);
+const char *ceph_session_op_name(int op);
+const char *ceph_mds_op_name(int op);
+const char *ceph_cap_op_name(int op);
+const char *ceph_lease_op_name(int o);
+const char *ceph_snap_op_name(int o);
+const char *ceph_watch_event_name(int e);
+const char *ceph_pool_op_name(int op);
+const char *ceph_osd_backoff_op_name(int op);
index b9c33d7d824deecfc2ef55c021b27d0335d483d8..37d02bd94df46f974c1552020827c714b2b1d73c 100644 (file)
  */
 
 #include "common/entity_name.h"
+#include "common/ceph_strings.h"
 
 #include <sstream>
 
 using std::string;
 
-extern const char *ceph_entity_type_name(int type);
 
 const std::array<EntityName::str_to_entity_type_t, 6> EntityName::STR_TO_ENTITY_TYPE = {{
   { CEPH_ENTITY_TYPE_AUTH, "auth" },
index a7a852e31bf50246074ed02cf740b44893b9d8d7..ca26a1941eeff5f6c98bd3ea44cc4b9219c6df7b 100644 (file)
@@ -195,11 +195,6 @@ extern const char *ceph_osd_state_name(int s);
 #define CEPH_RELEASE_OCTOPUS    15
 #define CEPH_RELEASE_MAX        16  /* highest + 1 */
 
-extern const char *ceph_release_name(int r);
-extern int ceph_release_from_name(const char *s);
-extern uint64_t ceph_release_features(int r);
-extern int ceph_release_from_features(uint64_t features);
-
 /*
  * The error code to return when an OSD can't handle a write
  * because it is too large.