From 97fa4df4d9fa9c68759795e4d46bcc432ac84a80 Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Tue, 3 Sep 2019 11:33:47 +0530 Subject: [PATCH] mds: Reorganize class members in Anchor header Fixes: https://tracker.ceph.com/issues/41607 Signed-off-by: Varsha Rao --- src/mds/Anchor.h | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/mds/Anchor.h b/src/mds/Anchor.h index e05a6298d7c..da7c6d1a999 100644 --- a/src/mds/Anchor.h +++ b/src/mds/Anchor.h @@ -28,13 +28,6 @@ */ 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& 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 -- 2.39.5