File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1007,11 +1007,19 @@ librados::IoCtx duplicate_io_ctx(librados::IoCtx& io_ctx) {
10071007 }
10081008
10091009 // atomically reset the data IOContext to new version
1010+ #ifdef __cpp_lib_atomic_shared_ptr
1011+ data_io_context.store (ctx);
1012+ #else
10101013 atomic_store (&data_io_context, ctx);
1014+ #endif
10111015 }
10121016
10131017 IOContext ImageCtx::get_data_io_context () const {
1018+ #ifdef __cpp_lib_atomic_shared_ptr
1019+ return data_io_context.load ();
1020+ #else
10141021 return atomic_load (&data_io_context);
1022+ #endif
10151023 }
10161024
10171025 IOContext ImageCtx::duplicate_data_io_context () const {
Original file line number Diff line number Diff line change @@ -366,7 +366,11 @@ namespace librbd {
366366 ceph::mutex **timer_lock);
367367
368368 private:
369+ #ifdef __cpp_lib_atomic_shared_ptr
370+ std::atomic<std::shared_ptr<neorados::IOContext>> data_io_context;
371+ #else
369372 std::shared_ptr<neorados::IOContext> data_io_context;
373+ #endif
370374 };
371375}
372376
You can’t perform that action at this time.
0 commit comments