]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: restore CInode::get_oldest_snap()
authorSage Weil <sage@newdream.net>
Mon, 26 Jul 2010 18:44:59 +0000 (11:44 -0700)
committerSage Weil <sage@newdream.net>
Mon, 26 Jul 2010 18:44:59 +0000 (11:44 -0700)
It's either 'first', for the first for the oldest old_inode.

src/mds/CInode.cc
src/mds/CInode.h

index 6726d249268c725ec740cf49a2610e7479085cc1..88b9f71dc8d0d3709cff5a8dd3b338b097c2e294 100644 (file)
@@ -1454,6 +1454,14 @@ pair<int,int> CInode::authority()
 
 // SNAP
 
+snapid_t CInode::get_oldest_snap()
+{
+  snapid_t t = first;
+  if (!old_inodes.empty())
+    t = old_inodes.begin()->second.first;
+  return MIN(t, first);
+}
+
 old_inode_t& CInode::cow_old_inode(snapid_t follows, inode_t *pi)
 {
   assert(follows >= first);
index f4b9b37528a905eb12fb6c5ab82e3377a0f1a13b..e1aec5ee30b32e833671f833397b7a662c7cff29 100644 (file)
@@ -166,6 +166,7 @@ public:
       inode.nlink > 1 || // there are remote links, possibly snapped, that will need to find me
       old_inodes.size(); // once multiversion, always multiversion.  until old_inodes gets cleaned out.
   }
+  snapid_t get_oldest_snap();
 
   loff_t last_journaled;       // log offset for the last time i was journaled
   //loff_t last_open_journaled;  // log offset for the last journaled EOpen