summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-05-25 22:36:49 -0700
committerSage Weil <sage@inktank.com>2012-06-12 11:50:53 -0700
commit4cc122cc9379088d63cbbc432b2bdfd1efbe0aac (patch)
tree44a2d904bf35da8649de122a9c448f36e42a3b47 /src/common
parentb88a5e5344b34db3404ab1a0b32b8f1b9eb83a09 (diff)
downloadceph-4cc122cc9379088d63cbbc432b2bdfd1efbe0aac.tar.gz
entity_name: is_*() methods
Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/entity_name.cc12
-rw-r--r--src/common/entity_name.h9
2 files changed, 7 insertions, 14 deletions
diff --git a/src/common/entity_name.cc b/src/common/entity_name.cc
index 6f9214e8b8e..2e0b0cb1d9e 100644
--- a/src/common/entity_name.cc
+++ b/src/common/entity_name.cc
@@ -121,18 +121,6 @@ get_type_str() const
return ceph_entity_type_name(type);
}
-bool EntityName::
-is_admin() const
-{
- return (id.compare("admin") == 0);
-}
-
-uint32_t EntityName::
-get_type() const
-{
- return type;
-}
-
const char *EntityName::
get_type_name() const
{
diff --git a/src/common/entity_name.h b/src/common/entity_name.h
index 07ac730e3bf..550bf1dedc6 100644
--- a/src/common/entity_name.h
+++ b/src/common/entity_name.h
@@ -55,8 +55,13 @@ struct EntityName
void set_name(entity_name_t n);
const char* get_type_str() const;
- bool is_admin() const;
- uint32_t get_type() const;
+
+ uint32_t get_type() const { return type; }
+ bool is_osd() const { return get_type() == CEPH_ENTITY_TYPE_OSD; }
+ bool is_mds() const { return get_type() == CEPH_ENTITY_TYPE_MDS; }
+ bool is_client() const { return get_type() == CEPH_ENTITY_TYPE_CLIENT; }
+ bool is_mon() const { return get_type() == CEPH_ENTITY_TYPE_MON; }
+
const char * get_type_name() const;
const std::string &get_id() const;
bool has_default_id() const;