]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: Reorganize class members in Anchor header
authorVarsha Rao <varao@redhat.com>
Tue, 3 Sep 2019 06:03:47 +0000 (11:33 +0530)
committerVarsha Rao <varao@redhat.com>
Wed, 4 Sep 2019 12:58:15 +0000 (18:28 +0530)
Fixes: https://tracker.ceph.com/issues/41607
Signed-off-by: Varsha Rao <varao@redhat.com>
src/mds/Anchor.h

index e05a6298d7c9e572228d81624f3f0dbe7bb9267b..da7c6d1a999a797ea7e6169318b0f3d7909bbfc1 100644 (file)
  */
 class Anchor {
 public:
-  inodeno_t ino;       // anchored ino
-  inodeno_t dirino;
-  std::string d_name;
-  __u8 d_type = 0;
-
-  int omap_idx = -1;   // stored in which omap object
-
   Anchor() {}
   Anchor(inodeno_t i, inodeno_t di, std::string_view str, __u8 tp) :
     ino(i), dirino(di), d_name(str), d_type(tp) {}
@@ -43,15 +36,19 @@ public:
   void decode(bufferlist::const_iterator &bl);
   void dump(Formatter *f) const;
   static void generate_test_instances(std::list<Anchor*>& ls);
-};
-WRITE_CLASS_ENCODER(Anchor)
+  bool operator==(const Anchor &r) {
+    return ino == r.ino && dirino == r.dirino &&
+    d_name == r.d_name && d_type == r.d_type;
+  }
 
-inline bool operator==(const Anchor &l, const Anchor &r) {
-  return l.ino == r.ino && l.dirino == r.dirino &&
-        l.d_name == r.d_name && l.d_type == r.d_type;
-}
+  inodeno_t ino;       // anchored ino
+  inodeno_t dirino;
+  std::string d_name;
+  __u8 d_type = 0;
 
-ostream& operator<<(ostream& out, const Anchor &a);
+  int omap_idx = -1;   // stored in which omap object
+};
+WRITE_CLASS_ENCODER(Anchor)
 
 class RecoveredAnchor : public Anchor {
 public:
@@ -70,4 +67,5 @@ public:
   mutable int nref = 0; // how many children
 };
 
+ostream& operator<<(ostream& out, const Anchor &a);
 #endif