]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add coll_t is_temp() and is_meta()
authorSage Weil <sage@redhat.com>
Mon, 22 Dec 2014 22:43:46 +0000 (14:43 -0800)
committerSage Weil <sage@redhat.com>
Fri, 19 Jun 2015 00:02:46 +0000 (17:02 -0700)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/osd_types.cc
src/osd/osd_types.h

index eeaab4db0ebb924370e7d07c8c63863aa5376661..c17d03de9fc872e0f292d31605514f3eed1527ff 100644 (file)
@@ -548,6 +548,14 @@ ostream& operator<<(ostream& out, const pg_t &pg)
 
 // -- coll_t --
 
+bool coll_t::is_temp() const
+{
+  if (str.length() > 5 &&
+      strncmp(str.c_str() + str.length() - 5, "_TEMP", 5) == 0)
+    return true;
+  return false;
+}
+
 bool coll_t::is_temp(spg_t& pgid) const
 {
   const char *cstr(str.c_str());
index b21e68044d3f391e1793bf93542ea09666d1dbfe..ab349dfe1d0cf00c74538c410abbf2398de1add3 100644 (file)
@@ -506,9 +506,13 @@ public:
     return str < rhs.str;
   }
 
+  bool is_meta() const {
+    return str == string("meta");
+  }
   bool is_pg_prefix(spg_t& pgid) const;
   bool is_pg(spg_t& pgid, snapid_t& snap) const;
   bool is_temp(spg_t& pgid) const;
+  bool is_temp() const;
   bool is_removal(uint64_t *seq, spg_t *pgid) const;
   void encode(bufferlist& bl) const;
   void decode(bufferlist::iterator& bl);