From: Radoslaw Zarzynski Date: Thu, 17 Jul 2025 14:25:28 +0000 (+0000) Subject: crimson/osd, osd: build and link ECCommon X-Git-Tag: v21.0.0~3^2~96 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=32c18e0d7b915f2b44a3b5acca10a17907a76308;p=ceph.git crimson/osd, osd: build and link ECCommon The modifications of the code shared with the classical OSD boil down to just adding some `WITH_CRIMSON` guards; nothing more. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/crimson/osd/CMakeLists.txt b/src/crimson/osd/CMakeLists.txt index 4fdcb4bba32a..7cecc53c36e8 100644 --- a/src/crimson/osd/CMakeLists.txt +++ b/src/crimson/osd/CMakeLists.txt @@ -46,6 +46,8 @@ add_executable(crimson-osd objclass.cc ${PROJECT_SOURCE_DIR}/src/objclass/class_api.cc ${PROJECT_SOURCE_DIR}/src/osd/ClassHandler.cc + ${PROJECT_SOURCE_DIR}/src/osd/ECCommon.cc + ${PROJECT_SOURCE_DIR}/src/osd/ECExtentCache.cc ${PROJECT_SOURCE_DIR}/src/osd/ECUtil.cc ${PROJECT_SOURCE_DIR}/src/osd/ECUtilL.cc ${PROJECT_SOURCE_DIR}/src/osd/osd_op_util.cc diff --git a/src/osd/ECCommon.cc b/src/osd/ECCommon.cc index 62b0615ee6aa..c995c1663e0b 100644 --- a/src/osd/ECCommon.cc +++ b/src/osd/ECCommon.cc @@ -158,11 +158,13 @@ void ECCommon::ReadPipeline::get_all_avail_shards( continue; } const shard_id_t &shard = pg_shard.shard; +#ifndef WITH_CRIMSON if (cct->_conf->bluestore_debug_inject_read_err && ECInject::test_read_error1(ghobject_t(hoid, ghobject_t::NO_GEN, shard))) { dout(0) << __func__ << " Error inject - Missing shard " << shard << dendl; continue; } +#endif if (!missing.is_missing(hoid)) { ceph_assert(!have.contains(shard)); have.insert(shard); @@ -924,12 +926,14 @@ void ECCommon::RMWPipeline::cache_ready(Op &op) { if (pg_shard == get_parent()->whoami_shard()) { should_write_local = true; local_write_op.claim(sop); +#ifndef WITH_CRIMSON } else if (cct->_conf->bluestore_debug_inject_read_err && ECInject::test_write_error1(ghobject_t(op.hoid, ghobject_t::NO_GEN, pg_shard.shard))) { dout(0) << " Error inject - Dropping write message to shard " << pg_shard.shard << dendl; +#endif } else { auto *r = new MOSDECSubOpWrite(sop); r->pgid = spg_t(get_parent()->primary_spg_t().pgid, pg_shard.shard); diff --git a/src/osd/ECCommon.h b/src/osd/ECCommon.h index 8300964c4ffb..79d094c04f8c 100644 --- a/src/osd/ECCommon.h +++ b/src/osd/ECCommon.h @@ -794,7 +794,11 @@ struct ECCommon { << " missing_on_shards=" << missing_on_shards << " recovery_info=" << recovery_info << " recovery_progress=" << recovery_progress +#ifndef WITH_CRIMSON << " obc refcount=" << obc.use_count() +#else + << " obc refcount=" << obc->get_use_count() +#endif << " state=" << ECCommon::RecoveryBackend::RecoveryOp::tostr(state) << " waiting_on_pushes=" << waiting_on_pushes << ")";