From: myoungwon oh Date: Fri, 7 Aug 2020 07:29:04 +0000 (+0900) Subject: osd: make dec_refcount simple X-Git-Tag: v16.1.0~1248^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7013c941928928bdd13934fc9f10fc08c53bee2e;p=ceph.git osd: make dec_refcount simple Use hobject_t as a input paramter instead of ObjectContextRef Signed-off-by: Myoungwon Oh --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 09974ee05789..d5adac22051b 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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()) { diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index 8fe7481e26cd..87eec7163028 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -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);