]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd_types: move code for pg_log_entry_t::get_key_name into eversion_t
authorSamuel Just <sam.just@inktank.com>
Mon, 10 Jun 2013 22:04:43 +0000 (15:04 -0700)
committerSamuel Just <sam.just@inktank.com>
Mon, 17 Jun 2013 21:50:52 +0000 (14:50 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/osd_types.cc
src/osd/osd_types.h

index 25eeacb4b416c8089aa9cd16f0b7ec2715a0f86a..2f05bb9c24685bd8ebf9f60820646db395c73c54 100644 (file)
@@ -478,6 +478,15 @@ std::string pg_state_string(int state)
 }
 
 
+// -- eversion_t --
+string eversion_t::get_key_name() const
+{
+  char key[40];
+  snprintf(
+    key, sizeof(key), "%010u.%020llu", epoch, (long long unsigned)version);
+  return string(key);
+}
+
 
 // -- pool_snap_info_t --
 void pool_snap_info_t::dump(Formatter *f) const
@@ -1778,9 +1787,7 @@ void pg_query_t::generate_test_instances(list<pg_query_t*>& o)
 
 string pg_log_entry_t::get_key_name() const
 {
-  char key[40];
-  snprintf(key, sizeof(key), "%010u.%020llu", version.epoch, (long long unsigned)version.version);
-  return string(key);
+  return version.get_key_name();
 }
 
 void pg_log_entry_t::encode_with_checksum(bufferlist& bl) const
index aafaa67b2bc88730167ea8915a66363a1a9ae92b..a266fff24eef9552d7392154923ee2acdec0b976 100644 (file)
@@ -467,6 +467,8 @@ public:
     version++;
   }
 
+  string get_key_name() const;
+
   void encode(bufferlist &bl) const {
     ::encode(version, bl);
     ::encode(epoch, bl);