SIGN IN SIGN UP

crimson: fix intrusive_ptr_add_ref ADL lookup for Boost 1.89+

Boost 1.89+ makes boost::intrusive_ptr constructors/destructors
constexpr (via BOOST_SP_CXX20_CONSTEXPR). This triggers two-phase
name lookup on the template body:

  Phase 1 (definition context): ordinary unqualified lookup
  Phase 2 (instantiation context): ADL only

The problem: intrusive_ptr<PG> is instantiated when PG is still an
incomplete type (only forward-declared). ADL on an incomplete type
can only see the type's own associated namespace — it cannot
traverse base classes. The friend functions live in
boost::sp_adl_block (via intrusive_ref_counter), which ADL cannot
reach for an incomplete type. Ordinary lookup also fails because
boost/intrusive_ptr.hpp enters the include chain early via Seastar
headers (reactor.hh → pollable_fd.hh), before any ceph header
declaring the ADL functions.

Without constexpr (pre-Boost 1.89), the function body was checked
in a single pass at instantiation time, so ADL worked despite the
incomplete type. The constexpr change exposed this latent bug.

This is the same root cause as cbdd9c4b1f69 (TrackedOp fix).

Fix by providing explicit ADL functions in the correct namespace
for:
- FuturizedCollection: global namespace, with the include added
  to futurized_store.h to ensure visibility before instantiation
- Node hierarchy (crimson::os::seastore::onode namespace)
- PG (crimson::osd namespace): declarations in type_helpers.h,
  implementations in pg.h. Must be in PG's own namespace so that
  ADL on crimson::osd::PG* finds them without needing to traverse
  the base class.

Also add missing MOSDECSubOp* includes to osd.cc for the
boost::static_pointer_cast calls.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
K
Kefu Chai committed
f735d356e2c91afb3f7ed3cd4a1cf728adb99600
Parent: 205024d