summaryrefslogtreecommitdiffstats
path: root/src/librbd/operation/SnapshotRollbackRequest.h
diff options
context:
space:
mode:
authorVictor Denisov <denisovenator@gmail.com>2017-01-30 23:04:13 +0100
committerVictor Denisov <denisovenator@gmail.com>2017-03-16 08:48:09 +0100
commitde85e007e7926f56d0a83126ee2e3f01a9184b82 (patch)
treea45cd0508bd692c71ab131bc61a185cb8fb38415 /src/librbd/operation/SnapshotRollbackRequest.h
parentMerge pull request #13935 from chuang-he/fix_mutex_locker_of_compressor (diff)
downloadceph-de85e007e7926f56d0a83126ee2e3f01a9184b82.tar.xz
ceph-de85e007e7926f56d0a83126ee2e3f01a9184b82.zip
librbd: Add snapshot namespace to snapshot-name index in ImageCtx
The essence of this huge change is to have two keys for indexing snap ids in ImageCtx. It used to be a map of (snap_name -> snap_id) now it's (snap_namespace, snap_name) -> snap_id. Therefore now snapshots can have the same name if they are in different namespaces. All the remaining changes are a consequece of this change of ImageCtx.snap_ids field. The only exception is: we assume that you can't rename snapshots from GroupSnapshotNamespaces. So rename operation always assumes UserSnapshotNamespace. Signed-off-by: Victor Denisov <denisovenator@gmail.com>
Diffstat (limited to 'src/librbd/operation/SnapshotRollbackRequest.h')
-rw-r--r--src/librbd/operation/SnapshotRollbackRequest.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/librbd/operation/SnapshotRollbackRequest.h b/src/librbd/operation/SnapshotRollbackRequest.h
index 5d1cb69e85c..a32a84dc27b 100644
--- a/src/librbd/operation/SnapshotRollbackRequest.h
+++ b/src/librbd/operation/SnapshotRollbackRequest.h
@@ -57,7 +57,9 @@ public:
*/
SnapshotRollbackRequest(ImageCtxT &image_ctx, Context *on_finish,
- const std::string &snap_name, uint64_t snap_id,
+ const cls::rbd::SnapshotNamespace &snap_namespace,
+ const std::string &snap_name,
+ uint64_t snap_id,
uint64_t snap_size, ProgressContext &prog_ctx);
~SnapshotRollbackRequest() override;
@@ -68,10 +70,11 @@ protected:
}
journal::Event create_event(uint64_t op_tid) const override {
- return journal::SnapRollbackEvent(op_tid, m_snap_name);
+ return journal::SnapRollbackEvent(op_tid, m_snap_namespace, m_snap_name);
}
private:
+ cls::rbd::SnapshotNamespace m_snap_namespace;
std::string m_snap_name;
uint64_t m_snap_id;
uint64_t m_snap_size;