diff options
author | Jason Dillaman <dillaman@redhat.com> | 2018-01-17 19:40:13 +0100 |
---|---|---|
committer | Jason Dillaman <dillaman@redhat.com> | 2018-01-26 16:32:40 +0100 |
commit | 4ad9d565a15c191fb24ff9832fb38b48a1ea82e9 (patch) | |
tree | 4a06298ba6305bf0c235e108c4dda70c333cecf4 /src/librbd/journal | |
parent | cls/rbd: automatically manage group op feature on images (diff) | |
download | ceph-4ad9d565a15c191fb24ff9832fb38b48a1ea82e9.tar.xz ceph-4ad9d565a15c191fb24ff9832fb38b48a1ea82e9.zip |
librbd: simplified retrieving snapshots from image header
Added a new cls 'snapshot_get' method that retrieves all snapshot
specific details to avoid the need to add a new cls method to
retrieve each individual snapshot data field.
The cls 'get_snapshot_namespace' method has been dropped since Luminous
clients will treat that as a user-generated snapshot (and that's all
that is supported by Luminous clients). The cls 'get_snapshot_timestamp'
method has been deprecated and can be removed once <=Luminous clients
are no longer supported.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Diffstat (limited to 'src/librbd/journal')
-rw-r--r-- | src/librbd/journal/Types.cc | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/librbd/journal/Types.cc b/src/librbd/journal/Types.cc index 597c4cd4e7a..b5f10e46d2f 100644 --- a/src/librbd/journal/Types.cc +++ b/src/librbd/journal/Types.cc @@ -207,7 +207,7 @@ void SnapEventBase::encode(bufferlist& bl) const { using ceph::encode; OpEventBase::encode(bl); encode(snap_name, bl); - encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl); + encode(snap_namespace, bl); } void SnapEventBase::decode(__u8 version, bufferlist::iterator& it) { @@ -216,16 +216,14 @@ void SnapEventBase::decode(__u8 version, bufferlist::iterator& it) { using ceph::decode; decode(snap_name, it); if (version >= 4) { - cls::rbd::SnapshotNamespaceOnDisk sn; - decode(sn, it); - snap_namespace = sn.snapshot_namespace; + decode(snap_namespace, it); } } void SnapEventBase::dump(Formatter *f) const { OpEventBase::dump(f); f->dump_string("snap_name", snap_name); - cls::rbd::SnapshotNamespaceOnDisk(snap_namespace).dump(f); + snap_namespace.dump(f); } void SnapCreateEvent::encode(bufferlist &bl) const { @@ -236,9 +234,7 @@ void SnapCreateEvent::decode(__u8 version, bufferlist::iterator& it) { using ceph::decode; SnapEventBase::decode(version, it); if (version == 3) { - cls::rbd::SnapshotNamespaceOnDisk sn; - decode(sn, it); - snap_namespace = sn.snapshot_namespace; + decode(snap_namespace, it); } } @@ -579,7 +575,7 @@ void MirrorPeerSyncPoint::encode(bufferlist& bl) const { encode(snap_name, bl); encode(from_snap_name, bl); encode(object_number, bl); - encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl); + encode(snap_namespace, bl); } void MirrorPeerSyncPoint::decode(__u8 version, bufferlist::iterator& it) { @@ -588,9 +584,7 @@ void MirrorPeerSyncPoint::decode(__u8 version, bufferlist::iterator& it) { decode(from_snap_name, it); decode(object_number, it); if (version >= 2) { - cls::rbd::SnapshotNamespaceOnDisk sn; - decode(sn, it); - snap_namespace = sn.snapshot_namespace; + decode(snap_namespace, it); } } @@ -600,7 +594,7 @@ void MirrorPeerSyncPoint::dump(Formatter *f) const { if (object_number) { f->dump_unsigned("object_number", *object_number); } - cls::rbd::SnapshotNamespaceOnDisk(snap_namespace).dump(f); + snap_namespace.dump(f); } void MirrorPeerClientMeta::encode(bufferlist& bl) const { |