]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
entity_name: is_*() methods
authorSage Weil <sage@inktank.com>
Sat, 26 May 2012 05:36:49 +0000 (22:36 -0700)
committerSage Weil <sage@inktank.com>
Tue, 12 Jun 2012 18:50:53 +0000 (11:50 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/common/entity_name.cc
src/common/entity_name.h

index 6f9214e8b8ec64f922320d3c2d379057d927f52d..2e0b0cb1d9efee076f78f20728c52a8601a66d64 100644 (file)
@@ -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
 {
index 07ac730e3bf2f91f8f2ee8120b16c57f2e921dee..550bf1dedc60ebe178b65afaf090d7732ac4361a 100644 (file)
@@ -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;