From: Jason Dillaman Date: Fri, 17 Mar 2017 16:55:48 +0000 (-0400) Subject: Merge pull request #12970 from VictorDenisov/snapshot_namespace_index X-Git-Tag: v12.0.1~53 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=76d46b5406ad39bbe9509b139760ecf0889c0a54;p=ceph.git Merge pull request #12970 from VictorDenisov/snapshot_namespace_index librbd: add SnapshotNamespace to ImageCtx Reviewed-by: Jason Dillaman --- 76d46b5406ad39bbe9509b139760ecf0889c0a54 diff --cc src/librbd/journal/Types.cc index cef0dbfd130,249bc9122d2..c30a5752df2 --- a/src/librbd/journal/Types.cc +++ b/src/librbd/journal/Types.cc @@@ -77,7 -77,7 +77,7 @@@ void AioDiscardEvent::encode(bufferlist void AioDiscardEvent::decode(__u8 version, bufferlist::iterator& it) { ::decode(offset, it); ::decode(length, it); -- if (version >= 5) { ++ if (version >= 4) { ::decode(skip_partial_discard, it); } } @@@ -173,6 -174,11 +174,11 @@@ void SnapEventBase::encode(bufferlist& void SnapEventBase::decode(__u8 version, bufferlist::iterator& it) { OpEventBase::decode(version, it); ::decode(snap_name, it); - if (version >= 6) { ++ if (version >= 4) { + cls::rbd::SnapshotNamespaceOnDisk sn; + ::decode(sn, it); + snap_namespace = sn.snapshot_namespace; + } } void SnapEventBase::dump(Formatter *f) const { @@@ -187,7 -193,7 +193,7 @@@ void SnapCreateEvent::encode(bufferlis void SnapCreateEvent::decode(__u8 version, bufferlist::iterator& it) { SnapEventBase::decode(version, it); - if (version >= 3) { - if (3 <= version && version < 6) { ++ if (version == 3) { cls::rbd::SnapshotNamespaceOnDisk sn; ::decode(sn, it); snap_namespace = sn.snapshot_namespace; @@@ -340,7 -347,7 +347,7 @@@ EventType EventEntry::get_event_type() } void EventEntry::encode(bufferlist& bl) const { - ENCODE_START(5, 1, bl); - ENCODE_START(6, 1, bl); ++ ENCODE_START(4, 1, bl); boost::apply_visitor(EncodeVisitor(bl), event); ENCODE_FINISH(bl); encode_metadata(bl);