]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/osd_types: pass legacy flag to from_snap_set
authorSage Weil <sage@redhat.com>
Wed, 5 Apr 2017 19:14:31 +0000 (15:14 -0400)
committerSage Weil <sage@redhat.com>
Fri, 5 May 2017 17:38:12 +0000 (13:38 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/osd_types.cc
src/osd/osd_types.h

index f1d0c8ba03f1bd1819ad9a94ba0585ef62e40991..6245bfff02cd11e5b66b4f46e82005f014db2556 100644 (file)
@@ -4781,7 +4781,7 @@ ostream& operator<<(ostream& out, const SnapSet& cs)
   }
 }
 
-void SnapSet::from_snap_set(const librados::snap_set_t& ss)
+void SnapSet::from_snap_set(const librados::snap_set_t& ss, bool legacy)
 {
   // NOTE: our reconstruction of snaps (and the snapc) is not strictly
   // correct: it will not include snaps that still logically exist
@@ -4807,6 +4807,13 @@ void SnapSet::from_snap_set(const librados::snap_set_t& ss)
       for (vector<pair<uint64_t, uint64_t> >::const_iterator q =
             p->overlap.begin(); q != p->overlap.end(); ++q)
        clone_overlap[p->cloneid].insert(q->first, q->second);
+      if (!legacy) {
+       // p->snaps is ascending; clone_snaps is descending
+       vector<snapid_t>& v = clone_snaps[p->cloneid];
+       for (auto q = p->snaps.rbegin(); q != p->snaps.rend(); ++q) {
+         v.push_back(*q);
+       }
+      }
     }
   }
 
index 4c719e6c00677bde3d474099562c18a4bbd29e8f..68804cad15103a7242f8c2ea44572ad705f28e5e 100644 (file)
@@ -4317,7 +4317,7 @@ struct SnapSet {
   }
 
   /// populate SnapSet from a librados::snap_set_t
-  void from_snap_set(const librados::snap_set_t& ss);
+  void from_snap_set(const librados::snap_set_t& ss, bool legacy);
 
   /// get space accounted to clone
   uint64_t get_clone_bytes(snapid_t clone) const;