#define CEPH_LIBRBD_MIRROR_SNAPSHOT_UNLINK_PEER_REQUEST_H
#include "include/buffer.h"
+#include "cls/rbd/cls_rbd_client.h"
#include <string>
#include <set>
public:
static UnlinkPeerRequest *create(ImageCtxT *image_ctx, uint64_t snap_id,
const std::string &mirror_peer_uuid,
- Context *on_finish) {
+ bool allow_remove, Context *on_finish) {
return new UnlinkPeerRequest(image_ctx, snap_id, mirror_peer_uuid,
- on_finish);
+ allow_remove, on_finish);
}
UnlinkPeerRequest(ImageCtxT *image_ctx, uint64_t snap_id,
- const std::string &mirror_peer_uuid, Context *on_finish)
+ const std::string &mirror_peer_uuid, bool allow_remove,
+ Context *on_finish)
: m_image_ctx(image_ctx), m_snap_id(snap_id),
- m_mirror_peer_uuid(mirror_peer_uuid), m_on_finish(on_finish) {
+ m_mirror_peer_uuid(mirror_peer_uuid), m_allow_remove(allow_remove),
+ m_on_finish(on_finish) {
}
void send();
ImageCtxT *m_image_ctx;
uint64_t m_snap_id;
std::string m_mirror_peer_uuid;
+ bool m_allow_remove;
Context *m_on_finish;
- bool m_newer_mirror_snapshots = false;
-
void refresh_image();
void handle_refresh_image(int r);
void notify_update();
void handle_notify_update(int r);
- void remove_snapshot();
+ void remove_snapshot(const cls::rbd::SnapshotNamespace& snap_namespace,
+ const std::string& snap_name);
void handle_remove_snapshot(int r);
void finish(int r);