int is_snap_protected(string in_snap_name, bool *is_protected) const;
void add_snap(std::string in_snap_name, librados::snap_t id,
uint64_t in_size, uint64_t features,
- cls_client::parent_info parent,
- uint8_t protection_status);
+ parent_info parent, uint8_t protection_status);
uint64_t get_image_size(librados::snap_t in_snap_id) const;
int get_features(librados::snap_t in_snap_id,
uint64_t *out_features) const;
parent_info parent;
uint8_t protection_status;
SnapInfo(librados::snap_t _id, uint64_t _size, uint64_t _features,
- cls_client::parent_info _parent, uint8_t _protection_status) :
+ parent_info _parent, uint8_t _protection_status) :
id(_id), size(_size), features(_features), parent(_parent),
protection_status(_protection_status) {}
};
#include "include/types.h"
#include "include/buffer.h"
#include "common/Formatter.h"
-
-enum {
- RBD_PROTECTION_STATUS_UNPROTECTED = 0,
- RBD_PROTECTION_STATUS_UNPROTECTING = 1,
- RBD_PROTECTION_STATUS_PROTECTED = 2,
- RBD_PROTECTION_STATUS_LAST = 3
-};
+#include "librbd/parent_types.h"
/// information about our parent image, if any
struct cls_rbd_parent {
return r;
notify_change(ictx->md_ctx, ictx->header_oid, NULL, ictx);
- cls_client::parent_spec pspec(ictx->md_ctx.get_id(), ictx->id,
+ parent_spec pspec(ictx->md_ctx.get_id(), ictx->id,
ictx->snap_id);
// search all pools for children depending on this snapshot
Rados rados(ictx->md_ctx);
<< *it << dendl;
goto reprotect_and_return_err;
}
- r = get_children(&pool_ioctx, RBD_CHILDREN, pspec, children);
+ r = cls_client::get_children(&pool_ioctx, RBD_CHILDREN, pspec, children);
// key should not exist for this parent if there is no entry
if (((r < 0) && (r != -ENOENT))) {
lderr(ictx->cct) << "can't get children for pool " << *it << dendl;
};
}
+enum {
+ RBD_PROTECTION_STATUS_UNPROTECTED = 0,
+ RBD_PROTECTION_STATUS_UNPROTECTING = 1,
+ RBD_PROTECTION_STATUS_PROTECTED = 2,
+ RBD_PROTECTION_STATUS_LAST = 3
+};
+
#endif