Skip to content

Commit

Permalink
Update protection methods to use parent_spec, parent_types.h, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Mick committed Aug 18, 2012
1 parent bd2e751 commit e21bac9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/librbd/ImageCtx.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ namespace librbd {
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;
Expand Down
2 changes: 1 addition & 1 deletion src/librbd/SnapInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace librbd {
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) {}
};
Expand Down
8 changes: 1 addition & 7 deletions src/librbd/cls_rbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@
#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 {
Expand Down
4 changes: 2 additions & 2 deletions src/librbd/internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ namespace librbd {
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);
Expand All @@ -560,7 +560,7 @@ namespace librbd {
<< *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;
Expand Down
7 changes: 7 additions & 0 deletions src/librbd/parent_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,11 @@ namespace librbd {
};
}

enum {
RBD_PROTECTION_STATUS_UNPROTECTED = 0,
RBD_PROTECTION_STATUS_UNPROTECTING = 1,
RBD_PROTECTION_STATUS_PROTECTED = 2,
RBD_PROTECTION_STATUS_LAST = 3
};

#endif

0 comments on commit e21bac9

Please sign in to comment.