From: Greg Farnum Date: Tue, 6 Jan 2015 22:07:03 +0000 (-0800) Subject: mds: frag_t: add scrub stamp and version for recursive and local scrubs X-Git-Tag: v10.0.1~51^2~21 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2cbf07b96f871ee71f163deddaab932c94d4eab0;p=ceph.git mds: frag_t: add scrub stamp and version for recursive and local scrubs 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 --- diff --git a/src/mds/mdstypes.cc b/src/mds/mdstypes.cc index 6b4311657d69..08879c32a096 100644 --- a/src/mds/mdstypes.cc +++ b/src/mds/mdstypes.cc @@ -568,7 +568,7 @@ void old_inode_t::generate_test_instances(list& 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); } diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index 52c01564de38..669e8b9a702d 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -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& ls); - fnode_t() : version(0) {} + fnode_t() : version(0), + recursive_scrub_version(0), localized_scrub_version(0) {} }; WRITE_CLASS_ENCODER(fnode_t)