From: Varsha Rao Date: Tue, 3 Sep 2019 06:03:47 +0000 (+0530) Subject: mds: Reorganize class members in Anchor header X-Git-Tag: v15.1.0~1579^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=97fa4df4d9fa9c68759795e4d46bcc432ac84a80;p=ceph.git mds: Reorganize class members in Anchor header Fixes: https://tracker.ceph.com/issues/41607 Signed-off-by: Varsha Rao --- 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