]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/mdstypes: add btime to inode
authorSage Weil <sage@redhat.com>
Mon, 29 Aug 2016 11:16:37 +0000 (07:16 -0400)
committerJeff Layton <jlayton@redhat.com>
Mon, 29 Aug 2016 11:16:37 +0000 (07:16 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mds/mdstypes.cc
src/mds/mdstypes.h

index 1428af65f0f80dfcfad6a358ae1588b8d687c4b2..6432a2c0cf50932503d42b655c3ff6bfc4e8ccbd 100644 (file)
@@ -238,7 +238,7 @@ void inline_data_t::decode(bufferlist::iterator &p)
  */
 void inode_t::encode(bufferlist &bl, uint64_t features) const
 {
-  ENCODE_START(13, 6, bl);
+  ENCODE_START(14, 6, bl);
 
   ::encode(ino, bl);
   ::encode(rdev, bl);
@@ -285,12 +285,14 @@ void inode_t::encode(bufferlist &bl, uint64_t features) const
   ::encode(last_scrub_version, bl);
   ::encode(last_scrub_stamp, bl);
 
+  ::encode(btime, bl);
+
   ENCODE_FINISH(bl);
 }
 
 void inode_t::decode(bufferlist::iterator &p)
 {
-  DECODE_START_LEGACY_COMPAT_LEN(13, 6, 6, p);
+  DECODE_START_LEGACY_COMPAT_LEN(14, 6, 6, p);
 
   ::decode(ino, p);
   ::decode(rdev, p);
@@ -363,6 +365,11 @@ void inode_t::decode(bufferlist::iterator &p)
     ::decode(last_scrub_version, p);
     ::decode(last_scrub_stamp, p);
   }
+  if (struct_v >= 14) {
+    ::decode(btime, p);
+  } else {
+    btime = utime_t();
+  }
 
   DECODE_FINISH(p);
 }
@@ -372,6 +379,7 @@ void inode_t::dump(Formatter *f) const
   f->dump_unsigned("ino", ino);
   f->dump_unsigned("rdev", rdev);
   f->dump_stream("ctime") << ctime;
+  f->dump_stream("btime") << btime;
   f->dump_unsigned("mode", mode);
   f->dump_unsigned("uid", uid);
   f->dump_unsigned("gid", gid);
@@ -443,6 +451,7 @@ int inode_t::compare(const inode_t &other, bool *divergent) const
   if (version == other.version) {
     if (rdev != other.rdev ||
         ctime != other.ctime ||
+        btime != other.btime ||
         mode != other.mode ||
         uid != other.uid ||
         gid != other.gid ||
index 7039e6c05c08f4093507d5327ddbeaf0c74f884b..a358d354f2ed662988c59795c991d2fff55b56dc 100644 (file)
@@ -470,6 +470,7 @@ struct inode_t {
 
   // affected by any inode change...
   utime_t    ctime;   // inode change time
+  utime_t    btime;   // birth time
 
   // perm (namespace permissions)
   uint32_t   mode;