]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
librbd: remove unused trim_image() method
authorIlya Dryomov <idryomov@gmail.com>
Mon, 17 Oct 2022 15:52:24 +0000 (17:52 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 4 Dec 2022 17:19:19 +0000 (18:19 +0100)
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/librbd/internal.cc
src/librbd/internal.h

index 297172e2c583cf52211d884ca19b92290bd16748..c9c1167608ca41820809aca7eea09508bd86898d 100644 (file)
@@ -206,26 +206,6 @@ int validate_pool(IoCtx &io_ctx, CephContext *cct) {
     return num;
   }
 
-  void trim_image(ImageCtx *ictx, uint64_t newsize, ProgressContext& prog_ctx)
-  {
-    ceph_assert(ceph_mutex_is_locked(ictx->owner_lock));
-    ceph_assert(ictx->exclusive_lock == nullptr ||
-                ictx->exclusive_lock->is_lock_owner());
-
-    C_SaferCond ctx;
-    ictx->image_lock.lock_shared();
-    operation::TrimRequest<> *req = operation::TrimRequest<>::create(
-      *ictx, &ctx, ictx->size, newsize, prog_ctx);
-    ictx->image_lock.unlock_shared();
-    req->send();
-
-    int r = ctx.wait();
-    if (r < 0) {
-      lderr(ictx->cct) << "warning: failed to remove some object(s): "
-                      << cpp_strerror(r) << dendl;
-    }
-  }
-
   int read_header_bl(IoCtx& io_ctx, const string& header_oid,
                     bufferlist& header, uint64_t *ver)
   {
index 50314a6e1780d2f0fa3a69df8fb59662ff2cc650..65e9a9d18fe689bcd7756745ba172243c8b7a314 100644 (file)
@@ -114,8 +114,6 @@ namespace librbd {
   int break_lock(ImageCtx *ictx, const std::string& client,
                 const std::string& cookie);
 
-  void trim_image(ImageCtx *ictx, uint64_t newsize, ProgressContext& prog_ctx);
-
   int read_header_bl(librados::IoCtx& io_ctx, const std::string& md_oid,
                     ceph::bufferlist& header, uint64_t *ver);
   int read_header(librados::IoCtx& io_ctx, const std::string& md_oid,