From: Jeff Layton Date: Mon, 29 Aug 2016 11:16:39 +0000 (-0400) Subject: mds/mdstypes: add change attribute to inode X-Git-Tag: v11.0.1~326^2~24 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6615553e8e8802a754901ddbe473274dc31f4351;p=ceph-ci.git mds/mdstypes: add change attribute to inode Signed-off-by: Jeff Layton --- diff --git a/src/mds/mdstypes.cc b/src/mds/mdstypes.cc index 6432a2c0cf5..20aa36fa156 100644 --- a/src/mds/mdstypes.cc +++ b/src/mds/mdstypes.cc @@ -286,6 +286,7 @@ void inode_t::encode(bufferlist &bl, uint64_t features) const ::encode(last_scrub_stamp, bl); ::encode(btime, bl); + ::encode(change_attr, bl); ENCODE_FINISH(bl); } @@ -367,8 +368,10 @@ void inode_t::decode(bufferlist::iterator &p) } if (struct_v >= 14) { ::decode(btime, p); + ::decode(change_attr, p); } else { btime = utime_t(); + change_attr = 0; } DECODE_FINISH(p); @@ -406,6 +409,7 @@ void inode_t::dump(Formatter *f) const f->dump_stream("mtime") << mtime; f->dump_stream("atime") << atime; f->dump_unsigned("time_warp_seq", time_warp_seq); + f->dump_unsigned("change_attr", change_attr); f->open_array_section("client_ranges"); for (map::const_iterator p = client_ranges.begin(); p != client_ranges.end(); ++p) { @@ -465,6 +469,7 @@ int inode_t::compare(const inode_t &other, bool *divergent) const truncate_size != other.truncate_size || truncate_from != other.truncate_from || truncate_pending != other.truncate_pending || + change_attr != other.change_attr || mtime != other.mtime || atime != other.atime || time_warp_seq != other.time_warp_seq || diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index a358d354f2e..c7dd37b6b8f 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -494,6 +494,9 @@ struct inode_t { uint32_t time_warp_seq; // count of (potential) mtime/atime timewarps (i.e., utimes()) inline_data_t inline_data; + // change attribute + uint64_t change_attr; + std::map client_ranges; // client(s) can write to these ranges // dirfrag, recursive accountin @@ -522,7 +525,7 @@ struct inode_t { size(0), max_size_ever(0), truncate_seq(0), truncate_size(0), truncate_from(0), truncate_pending(0), - time_warp_seq(0), + time_warp_seq(0), change_attr(0), version(0), file_data_version(0), xattr_version(0), last_scrub_version(0), backtrace_version(0) { clear_layout();