]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Reorganize structure members in snap header 32432/head
authorVarsha Rao <varao@redhat.com>
Thu, 26 Dec 2019 17:23:54 +0000 (22:53 +0530)
committerVarsha Rao <varao@redhat.com>
Mon, 27 Jan 2020 12:06:48 +0000 (17:36 +0530)
Fixes: https://tracker.ceph.com/issues/43425
Signed-off-by: Varsha Rao <varao@redhat.com>
src/mds/snap.h

index 9ccdf71fe24376cb8f80155a8ec872d152064ee1..9ebadb1255bb380d0810c3bbf47b91dc135521ef 100644 (file)
 #include "mdstypes.h"
 #include "common/snap_types.h"
 
+#include "Capability.h"
+
 /*
  * generic snap descriptor.
  */
 struct SnapInfo {
-  snapid_t snapid;
-  inodeno_t ino;
-  utime_t stamp;
-  string name;
-
-  mutable string long_name; ///< cached _$ino_$name
-  
   void encode(bufferlist &bl) const;
   void decode(bufferlist::const_iterator &bl);
   void dump(Formatter *f) const;
   static void generate_test_instances(std::list<SnapInfo*>& ls);
 
   std::string_view get_long_name() const;
+
+  snapid_t snapid;
+  inodeno_t ino;
+  utime_t stamp;
+  string name;
+
+  mutable string long_name; ///< cached _$ino_$name
 };
 WRITE_CLASS_ENCODER(SnapInfo)
 
@@ -48,63 +50,50 @@ inline bool operator==(const SnapInfo &l, const SnapInfo &r)
 
 ostream& operator<<(ostream& out, const SnapInfo &sn);
 
-
 /*
  * SnapRealm - a subtree that shares the same set of snapshots.
  */
 struct SnapRealm;
-class CInode;
-class MDCache;
-
-
-
-#include "Capability.h"
 
 struct snaplink_t {
-  inodeno_t ino;
-  snapid_t first;
-
   void encode(bufferlist &bl) const;
   void decode(bufferlist::const_iterator &bl);
   void dump(Formatter *f) const;
   static void generate_test_instances(std::list<snaplink_t*>& ls);
+
+  inodeno_t ino;
+  snapid_t first;
 };
 WRITE_CLASS_ENCODER(snaplink_t)
 
 ostream& operator<<(ostream& out, const snaplink_t &l);
 
-
 // carry data about a specific version of a SnapRealm
 struct sr_t {
-  snapid_t seq;                     // basically, a version/seq # for changes to _this_ realm.
-  snapid_t created;                 // when this realm was created.
-  snapid_t last_created;            // last snap created in _this_ realm.
-  snapid_t last_destroyed;          // seq for last removal
-  snapid_t current_parent_since;
-  map<snapid_t, SnapInfo> snaps;
-  map<snapid_t, snaplink_t> past_parents;  // key is "last" (or NOSNAP)
-  set<snapid_t> past_parent_snaps;
-
-  __u32 flags;
-  enum {
-    PARENT_GLOBAL = 1 << 0,
-  };
-
   void mark_parent_global() { flags |= PARENT_GLOBAL; }
   void clear_parent_global() { flags &= ~PARENT_GLOBAL; }
   bool is_parent_global() const { return flags & PARENT_GLOBAL; }
 
-  sr_t()
-    : seq(0), created(0),
-      last_created(0), last_destroyed(0),
-      current_parent_since(1), flags(0)
-  {}
-
   void encode(bufferlist &bl) const;
   void decode(bufferlist::const_iterator &bl);
   void dump(Formatter *f) const;
   static void generate_test_instances(std::list<sr_t*>& ls);
+
+  snapid_t seq = 0;                     // basically, a version/seq # for changes to _this_ realm.
+  snapid_t created = 0;                 // when this realm was created.
+  snapid_t last_created = 0;            // last snap created in _this_ realm.
+  snapid_t last_destroyed = 0;          // seq for last removal
+  snapid_t current_parent_since = 1;
+  map<snapid_t, SnapInfo> snaps;
+  map<snapid_t, snaplink_t> past_parents;  // key is "last" (or NOSNAP)
+  set<snapid_t> past_parent_snaps;
+
+  __u32 flags = 0;
+  enum {
+    PARENT_GLOBAL = 1 << 0,
+  };
 };
 WRITE_CLASS_ENCODER(sr_t)
 
+class MDCache;
 #endif