From: Kefu Chai Date: Mon, 29 Apr 2019 09:00:32 +0000 (+0800) Subject: common: add ceph_string.h X-Git-Tag: v15.1.0~2713^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5bf8cda6776dee2581a99cf2165243540696bf78;p=ceph.git common: add ceph_string.h 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 --- diff --git a/src/common/ceph_strings.cc b/src/common/ceph_strings.cc index 8711672689e8..515b986dc60f 100644 --- a/src/common/ceph_strings.cc +++ b/src/common/ceph_strings.cc @@ -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 index 000000000000..80e28755b712 --- /dev/null +++ b/src/common/ceph_strings.h @@ -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 + +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); diff --git a/src/common/entity_name.cc b/src/common/entity_name.cc index b9c33d7d824d..37d02bd94df4 100644 --- a/src/common/entity_name.cc +++ b/src/common/entity_name.cc @@ -13,12 +13,12 @@ */ #include "common/entity_name.h" +#include "common/ceph_strings.h" #include using std::string; -extern const char *ceph_entity_type_name(int type); const std::array EntityName::STR_TO_ENTITY_TYPE = {{ { CEPH_ENTITY_TYPE_AUTH, "auth" }, diff --git a/src/include/rados.h b/src/include/rados.h index a7a852e31bf5..ca26a1941eef 100644 --- a/src/include/rados.h +++ b/src/include/rados.h @@ -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.