]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: make dec_refcount simple
authormyoungwon oh <ohmyoungwon@gmail.com>
Fri, 7 Aug 2020 07:29:04 +0000 (16:29 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Tue, 18 Aug 2020 16:38:24 +0000 (01:38 +0900)
Use hobject_t as a input paramter instead of ObjectContextRef

Signed-off-by: Myoungwon Oh <myoungwon.oh@samsumg.com>
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index 09974ee05789ecb9db59df1a7d480327dc07a02c..d5adac22051b32422d52acee340db8d7b2a6935b 100644 (file)
@@ -3473,14 +3473,14 @@ ObjectContextRef PrimaryLogPG::get_prev_clone_obc(ObjectContextRef obc)
   return nullptr;
 }
 
-void PrimaryLogPG::dec_refcount(ObjectContextRef obc, const object_ref_delta_t& refs)
+void PrimaryLogPG::dec_refcount(const hobject_t& soid, const object_ref_delta_t& refs)
 {
   for (auto p = refs.begin(); p != refs.end(); ++p) {
     int dec_ref_count = p->second;
     ceph_assert(dec_ref_count < 0);
     while (dec_ref_count < 0) {
       dout(10) << __func__ << ": decrement reference on offset oid: " << p->first << dendl;
-      refcount_manifest(obc->obs.oi.soid, p->first, 
+      refcount_manifest(soid, p->first, 
                        refcount_t::DECREMENT_REF, NULL);
       dec_ref_count++;
     }
@@ -3513,9 +3513,7 @@ void PrimaryLogPG::dec_refcount_by_dirty(OpContext* ctx)
     ceph_assert(ctx);
     ctx->register_on_commit(
       [soid, this, refs](){
-       ObjectContextRef obc = get_object_context(soid, false, NULL);
-       ceph_assert(obc);
-       dec_refcount(obc, refs);
+       dec_refcount(soid, refs);
       });
   }
 }
@@ -3565,9 +3563,7 @@ void PrimaryLogPG::dec_all_refcount_manifest(const object_info_t& oi, OpContext*
       hobject_t soid = ctx->obc->obs.oi.soid;
       ctx->register_on_commit(
        [soid, this, refs](){
-         ObjectContextRef obc = get_object_context(soid, false, NULL);
-         ceph_assert(obc);
-         dec_refcount(obc, refs);
+         dec_refcount(soid, refs);
        });
     }
   } else if (oi.manifest.is_redirect()) {
index 8fe7481e26cdae3c7aa0f8c74a70a5eb5911821d..87eec7163028671b83b2ad318c47765bcd51889a 100644 (file)
@@ -1502,7 +1502,7 @@ protected:
   void refcount_manifest(hobject_t src_soid, hobject_t tgt_soid, refcount_t type,
                         RefCountCallback* cb);
   void dec_all_refcount_manifest(const object_info_t& oi, OpContext* ctx);
-  void dec_refcount(ObjectContextRef obc, const object_ref_delta_t& refs);
+  void dec_refcount(const hobject_t& soid, const object_ref_delta_t& refs);
   void dec_refcount_by_dirty(OpContext* ctx);
   bool is_dedup_chunk(const object_info_t& oi, const chunk_info_t& chunk);
   ObjectContextRef get_prev_clone_obc(ObjectContextRef obc);