]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Update protection methods to use parent_spec, parent_types.h, etc.
authorDan Mick <dan.mick@inktank.com>
Sat, 18 Aug 2012 00:58:31 +0000 (17:58 -0700)
committerDan Mick <dan.mick@inktank.com>
Sat, 18 Aug 2012 01:47:34 +0000 (18:47 -0700)
src/librbd/ImageCtx.h
src/librbd/SnapInfo.h
src/librbd/cls_rbd.h
src/librbd/internal.cc
src/librbd/parent_types.h

index 26ebd4771ef513e95b1b8be2a0f517a82875e86f..766ec097c082f74892637384a40b8ca33afa29ad 100644 (file)
@@ -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;
index 87c175b6b6e2a8b51f4dbe140e837872f2a8eb6a..ef648de45ef944f73655e9c624516e348efd9159 100644 (file)
@@ -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) {}
   };
index 31fb17dc463bb870b7644005f4b0e451decbc598..b0f6e1502ffbf3c01c9e4d8b070b1c8e00e502c1 100644 (file)
@@ -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 {
index 7a799eaa70b46a93251864647461430cca9722a2..5d4523a0051b165918a70660c53ad8892595be20 100644 (file)
@@ -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);
@@ -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;
index 07e6cfa503dc52d941e6d4b294e053ea110ebe09..4dcc452962f951cd25a25a8d1c7aebf607952930 100644 (file)
@@ -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