]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: cleanup: remove unused function
authorMykola Golub <mgolub@suse.com>
Tue, 12 Nov 2019 15:05:46 +0000 (15:05 +0000)
committerMykola Golub <mgolub@suse.com>
Tue, 10 Dec 2019 15:45:30 +0000 (15:45 +0000)
Signed-off-by: Mykola Golub <mgolub@suse.com>
src/librbd/api/Mirror.cc

index 6c0b233d0d65e5a70e9f944b1c9e69b643c3a0ed..4f7cb215ea1df3ab9b3b661761d7f2c1d1c39ff9 100644 (file)
@@ -241,24 +241,6 @@ int create_bootstrap_peer(CephContext* cct, librados::IoCtx& io_ctx,
   return 0;
 }
 
-template <typename I>
-int validate_mirroring_enabled(I *ictx) {
-  CephContext *cct = ictx->cct;
-  cls::rbd::MirrorImage mirror_image_internal;
-  int r = cls_client::mirror_image_get(&ictx->md_ctx, ictx->id,
-      &mirror_image_internal);
-  if (r < 0 && r != -ENOENT) {
-    lderr(cct) << "failed to retrieve mirroring state: " << cpp_strerror(r)
-               << dendl;
-    return r;
-  } else if (mirror_image_internal.state !=
-               cls::rbd::MIRROR_IMAGE_STATE_ENABLED) {
-    lderr(cct) << "mirroring is not currently enabled" << dendl;
-    return -EINVAL;
-  }
-  return 0;
-}
-
 int list_mirror_images(librados::IoCtx& io_ctx,
                        std::set<std::string>& mirror_image_ids) {
   CephContext *cct = reinterpret_cast<CephContext *>(io_ctx.cct());
@@ -448,7 +430,7 @@ int Mirror<I>::image_disable(I *ictx, bool force) {
     return -EINVAL;
   }
 
-  // is mirroring  enabled for the child?
+  // is mirroring  enabled for the image?
   cls::rbd::MirrorImage mirror_image_internal;
   r = cls_client::mirror_image_get(&ictx->md_ctx, ictx->id,
                                    &mirror_image_internal);