]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: explicitly instantiate interrupt_cond<IOInterruptCondition>
authorSamuel Just <sjust@redhat.com>
Wed, 25 Oct 2023 02:55:28 +0000 (19:55 -0700)
committerSamuel Just <sjust@redhat.com>
Mon, 11 Dec 2023 04:05:09 +0000 (04:05 +0000)
Solves an FTBFS when using with_interruption from pg_commands.cc:

In file included from ../src/crimson/admin/pg_commands.cc:14:
../src/crimson/common/interruptible_future.h:135:46: error: redefinition of ‘bool __tls_guard’
  135 | thread_local interrupt_cond_t<InterruptCond> interrupt_cond;
      |                                              ^~~~~~~~~~~~~~
In file included from ../src/common/TrackedOp.h:18,
                 from ../src/os/ObjectStore.h:25,
                 from ../src/osd/PGLog.h:23,
                 from ../src/osd/PeeringState.h:19,
                 from ../src/crimson/osd/shard_services.h:17,
                 from ../src/crimson/osd/pg_shard_manager.h:10,
                 from ../src/crimson/osd/osd.h:23,
                 from ../src/crimson/admin/pg_commands.cc:16:
../src/common/StackStringStream.h:188:36: note: ‘bool __tls_guard’ previously declared here
  188 |   inline static thread_local Cache cache;

This matches what we already do with
interrupt_cond_t<crimson::os::seastore::TransactionConflictCondition>.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/common/interruptible_future.h
src/crimson/osd/pg_interval_interrupt_condition.cc

index 6ed11088e1a7e5edfc4d80ae2ef94a10df508d2d..857704dab378677ce19b8f5faeec9b9945c6cc4e 100644 (file)
@@ -53,6 +53,10 @@ namespace crimson::os::seastore {
   class TransactionConflictCondition;
 }
 
+namespace crimson::osd {
+  class IOInterruptCondition;
+}
+
 // GCC tries to instantiate
 // seastar::lw_shared_ptr<crimson::os::seastore::TransactionConflictCondition>.
 // but we *may* not have the definition of TransactionConflictCondition at this moment,
@@ -136,6 +140,9 @@ struct interrupt_cond_t {
 template <typename InterruptCond>
 thread_local interrupt_cond_t<InterruptCond> interrupt_cond;
 
+extern template thread_local interrupt_cond_t<crimson::osd::IOInterruptCondition>
+interrupt_cond<crimson::osd::IOInterruptCondition>;
+
 extern template thread_local interrupt_cond_t<crimson::os::seastore::TransactionConflictCondition>
 interrupt_cond<crimson::os::seastore::TransactionConflictCondition>;
 
index 36243b825752506a49b2e19f9eca1e934cec4018..b72044d4e57e3babfcdbe812e775609830ff0140 100644 (file)
@@ -8,6 +8,11 @@
 
 SET_SUBSYS(osd);
 
+namespace crimson::interruptible {
+template thread_local interrupt_cond_t<crimson::osd::IOInterruptCondition>
+interrupt_cond<crimson::osd::IOInterruptCondition>;
+}
+
 namespace crimson::osd {
 
 IOInterruptCondition::IOInterruptCondition(Ref<PG>& pg)