]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds/mdstypes: add change attribute to inode
authorJeff Layton <jlayton@redhat.com>
Mon, 29 Aug 2016 11:16:39 +0000 (07:16 -0400)
committerJeff Layton <jlayton@redhat.com>
Mon, 29 Aug 2016 11:16:39 +0000 (07:16 -0400)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/mds/mdstypes.cc
src/mds/mdstypes.h

index 6432a2c0cf50932503d42b655c3ff6bfc4e8ccbd..20aa36fa156f84587e1cbfdbabbb96d7c9a6b6c3 100644 (file)
@@ -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<client_t,client_writeable_range_t>::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 ||
index a358d354f2ed662988c59795c991d2fff55b56dc..c7dd37b6b8fff8f32adecd3ab73cf2677710bc38 100644 (file)
@@ -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_t,client_writeable_range_t> 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();