]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: frag_t: add scrub stamp and version for recursive and local scrubs
authorGreg Farnum <gfarnum@redhat.com>
Tue, 6 Jan 2015 22:07:03 +0000 (14:07 -0800)
committerYan, Zheng <zyan@redhat.com>
Wed, 4 Nov 2015 09:17:24 +0000 (17:17 +0800)
The local scrub bits are just for the data stored in the dirfrag, like
checking rstats match the actual directory contents and such. The recursive
stats include actual scrubs on all the descendant files and directories too!

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/mds/mdstypes.cc
src/mds/mdstypes.h

index 6b4311657d694b2b4b6b64290f3fb57999b1f135..08879c32a0967a0e7a9bc10ef6df8bc9da805981 100644 (file)
@@ -568,7 +568,7 @@ void old_inode_t::generate_test_instances(list<old_inode_t*>& ls)
  */
 void fnode_t::encode(bufferlist &bl) const
 {
-  ENCODE_START(3, 3, bl);
+  ENCODE_START(4, 3, bl);
   ::encode(version, bl);
   ::encode(snap_purged_thru, bl);
   ::encode(fragstat, bl);
@@ -576,6 +576,10 @@ void fnode_t::encode(bufferlist &bl) const
   ::encode(rstat, bl);
   ::encode(accounted_rstat, bl);
   ::encode(damage_flags, bl);
+  ::encode(recursive_scrub_version, bl);
+  ::encode(recursive_scrub_stamp, bl);
+  ::encode(localized_scrub_version, bl);
+  ::encode(localized_scrub_stamp, bl);
   ENCODE_FINISH(bl);
 }
 
@@ -591,6 +595,12 @@ void fnode_t::decode(bufferlist::iterator &bl)
   if (struct_v >= 3) {
     ::decode(damage_flags, bl);
   }
+  if (struct_v >= 4) {
+    ::decode(recursive_scrub_version, bl);
+    ::decode(recursive_scrub_stamp, bl);
+    ::decode(localized_scrub_version, bl);
+    ::decode(localized_scrub_stamp, bl);
+  }
   DECODE_FINISH(bl);
 }
 
index 52c01564de3883156b5b4ee40c4a9a4f7e213111..669e8b9a702d170ad17d432fdede40325b9fcdf5 100644 (file)
@@ -614,11 +614,19 @@ struct fnode_t {
   nest_info_t rstat, accounted_rstat;
   damage_flags_t damage_flags;
 
+  // we know we and all our descendants have been scrubbed since this version
+  version_t recursive_scrub_version;
+  utime_t recursive_scrub_stamp;
+  // version at which we last scrubbed our personal data structures
+  version_t localized_scrub_version;
+  utime_t localized_scrub_stamp;
+
   void encode(bufferlist &bl) const;
   void decode(bufferlist::iterator& bl);
   void dump(Formatter *f) const;
   static void generate_test_instances(list<fnode_t*>& ls);
-  fnode_t() : version(0) {}
+  fnode_t() : version(0),
+             recursive_scrub_version(0), localized_scrub_version(0) {}
 };
 WRITE_CLASS_ENCODER(fnode_t)