]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds/DamageTable: move classes to .cc file
authorMichal Jarzabek <stiopa@gmail.com>
Tue, 11 Oct 2016 20:23:57 +0000 (21:23 +0100)
committerMichal Jarzabek <stiopa@gmail.com>
Tue, 11 Oct 2016 20:23:57 +0000 (21:23 +0100)
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
src/mds/DamageTable.cc
src/mds/DamageTable.h

index b8bcdda37d9c4ed813cdf7f77f7303e9b91530b2..a24f8c3d2d3bd3144fc27e69cf419a92a9b8593b 100644 (file)
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << rank << ".damage " << __func__ << " "
 
+namespace {
+/**
+ * Record damage to a particular dirfrag, implicitly affecting
+ * any dentries within it.
+ */
+class DirFragDamage : public DamageEntry
+{
+  public:
+  inodeno_t ino;
+  frag_t frag;
+
+  DirFragDamage(inodeno_t ino_, frag_t frag_)
+    : ino(ino_), frag(frag_)
+  {}
+
+  virtual damage_entry_type_t get_type() const
+  {
+    return DAMAGE_ENTRY_DIRFRAG;
+  }
+
+  void dump(Formatter *f) const
+  {
+    f->open_object_section("dir_frag_damage");
+    f->dump_string("damage_type", "dir_frag");
+    f->dump_int("id", id);
+    f->dump_int("ino", ino);
+    f->dump_stream("frag") << frag;
+    f->close_section();
+  }
+};
+
+
+/**
+ * Record damage to a particular dname within a particular dirfrag
+ */
+class DentryDamage : public DamageEntry
+{
+  public:
+  inodeno_t ino;
+  frag_t frag;
+  std::string dname;
+  snapid_t snap_id;
+
+  DentryDamage(
+      inodeno_t ino_,
+      frag_t frag_,
+      std::string dname_,
+      snapid_t snap_id_)
+    : ino(ino_), frag(frag_), dname(dname_), snap_id(snap_id_)
+  {}
+
+  virtual damage_entry_type_t get_type() const
+  {
+    return DAMAGE_ENTRY_DENTRY;
+  }
+
+  void dump(Formatter *f) const
+  {
+    f->open_object_section("dentry_damage");
+    f->dump_string("damage_type", "dentry");
+    f->dump_int("id", id);
+    f->dump_int("ino", ino);
+    f->dump_stream("frag") << frag;
+    f->dump_string("dname", dname);
+    f->dump_stream("snap_id") << snap_id;
+    f->close_section();
+  }
+};
+
+
+/**
+ * Record damage to our ability to look up an ino by number
+ */
+class BacktraceDamage : public DamageEntry
+{
+  public:
+  inodeno_t ino;
+
+  BacktraceDamage(inodeno_t ino_)
+    : ino(ino_)
+  {}
+
+  virtual damage_entry_type_t get_type() const
+  {
+    return DAMAGE_ENTRY_BACKTRACE;
+  }
+
+  void dump(Formatter *f) const
+  {
+    f->open_object_section("backtrace_damage");
+    f->dump_string("damage_type", "backtrace");
+    f->dump_int("id", id);
+    f->dump_int("ino", ino);
+    f->close_section();
+  }
+};
+}
 
 DamageEntry::~DamageEntry()
 {}
index cd82911d2e8f67bb05084937415b2e3477e8e3d6..998e0f84ea6d906def8490fc8540cf69fd7aa6bd 100644 (file)
@@ -53,101 +53,6 @@ class DamageEntry
 
 typedef ceph::shared_ptr<DamageEntry> DamageEntryRef;
 
-/**
- * Record damage to a particular dirfrag, implicitly affecting
- * any dentries within it.
- */
-class DirFragDamage : public DamageEntry
-{
-  public:
-  inodeno_t ino;
-  frag_t frag;
-
-  DirFragDamage(inodeno_t ino_, frag_t frag_)
-    : ino(ino_), frag(frag_)
-  {}
-
-  virtual damage_entry_type_t get_type() const
-  {
-    return DAMAGE_ENTRY_DIRFRAG;
-  }
-
-  void dump(Formatter *f) const
-  {
-    f->open_object_section("dir_frag_damage");
-    f->dump_string("damage_type", "dir_frag");
-    f->dump_int("id", id);
-    f->dump_int("ino", ino);
-    f->dump_stream("frag") << frag;
-    f->close_section();
-  }
-};
-
-
-/**
- * Record damage to a particular dname within a particular dirfrag
- */
-class DentryDamage : public DamageEntry
-{
-  public:
-  inodeno_t ino;
-  frag_t frag;
-  std::string dname;
-  snapid_t snap_id;
-
-  DentryDamage(
-      inodeno_t ino_,
-      frag_t frag_,
-      std::string dname_,
-      snapid_t snap_id_)
-    : ino(ino_), frag(frag_), dname(dname_), snap_id(snap_id_)
-  {}
-
-  virtual damage_entry_type_t get_type() const
-  {
-    return DAMAGE_ENTRY_DENTRY;
-  }
-
-  void dump(Formatter *f) const
-  {
-    f->open_object_section("dentry_damage");
-    f->dump_string("damage_type", "dentry");
-    f->dump_int("id", id);
-    f->dump_int("ino", ino);
-    f->dump_stream("frag") << frag;
-    f->dump_string("dname", dname);
-    f->dump_stream("snap_id") << snap_id;
-    f->close_section();
-  }
-};
-
-
-/**
- * Record damage to our ability to look up an ino by number
- */
-class BacktraceDamage : public DamageEntry
-{
-  public:
-  inodeno_t ino;
-
-  BacktraceDamage(inodeno_t ino_)
-    : ino(ino_)
-  {}
-
-  virtual damage_entry_type_t get_type() const
-  {
-    return DAMAGE_ENTRY_BACKTRACE;
-  }
-
-  void dump(Formatter *f) const
-  {
-    f->open_object_section("backtrace_damage");
-    f->dump_string("damage_type", "backtrace");
-    f->dump_int("id", id);
-    f->dump_int("ino", ino);
-    f->close_section();
-  }
-};
 
 class DirFragIdent
 {