diff options
author | Kefu Chai <kchai@redhat.com> | 2019-07-07 06:38:40 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2019-08-03 05:27:19 +0200 |
commit | a79837bcee5358ded3074a7c1b470737fd7c50e3 (patch) | |
tree | 620ca5eca49249253cbbbf96210893fbbd7cfff1 /src/librbd/journal | |
parent | journal: s/Mutex/ceph::mutex/ (diff) | |
download | ceph-a79837bcee5358ded3074a7c1b470737fd7c50e3.tar.xz ceph-a79837bcee5358ded3074a7c1b470737fd7c50e3.zip |
librbd: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src/librbd/journal')
-rw-r--r-- | src/librbd/journal/CreateRequest.h | 4 | ||||
-rw-r--r-- | src/librbd/journal/DemoteRequest.cc | 2 | ||||
-rw-r--r-- | src/librbd/journal/DemoteRequest.h | 4 | ||||
-rw-r--r-- | src/librbd/journal/OpenRequest.cc | 4 | ||||
-rw-r--r-- | src/librbd/journal/OpenRequest.h | 8 | ||||
-rw-r--r-- | src/librbd/journal/PromoteRequest.cc | 2 | ||||
-rw-r--r-- | src/librbd/journal/PromoteRequest.h | 4 | ||||
-rw-r--r-- | src/librbd/journal/RemoveRequest.h | 3 | ||||
-rw-r--r-- | src/librbd/journal/Replay.cc | 80 | ||||
-rw-r--r-- | src/librbd/journal/Replay.h | 4 | ||||
-rw-r--r-- | src/librbd/journal/ResetRequest.h | 1 | ||||
-rw-r--r-- | src/librbd/journal/Utils.cc | 4 | ||||
-rw-r--r-- | src/librbd/journal/Utils.h | 9 |
13 files changed, 63 insertions, 66 deletions
diff --git a/src/librbd/journal/CreateRequest.h b/src/librbd/journal/CreateRequest.h index c2b8cd9cf79..8a4e40f88c4 100644 --- a/src/librbd/journal/CreateRequest.h +++ b/src/librbd/journal/CreateRequest.h @@ -8,7 +8,7 @@ #include "include/buffer.h" #include "include/rados/librados.hpp" #include "include/rbd/librbd.hpp" -#include "common/Mutex.h" +#include "common/ceph_mutex.h" #include "librbd/ImageCtx.h" #include "journal/Journaler.h" #include "librbd/journal/Types.h" @@ -73,7 +73,7 @@ private: bufferlist m_bl; Journaler *m_journaler; SafeTimer *m_timer; - Mutex *m_timer_lock; + ceph::mutex *m_timer_lock; int m_r_saved; int64_t m_pool_id = -1; diff --git a/src/librbd/journal/DemoteRequest.cc b/src/librbd/journal/DemoteRequest.cc index 7656caac809..649388266b0 100644 --- a/src/librbd/journal/DemoteRequest.cc +++ b/src/librbd/journal/DemoteRequest.cc @@ -26,7 +26,7 @@ using librbd::util::create_context_callback; template <typename I> DemoteRequest<I>::DemoteRequest(I &image_ctx, Context *on_finish) : m_image_ctx(image_ctx), m_on_finish(on_finish), - m_lock("DemoteRequest::m_lock") { + m_lock(ceph::make_mutex("DemoteRequest::m_lock")) { } template <typename I> diff --git a/src/librbd/journal/DemoteRequest.h b/src/librbd/journal/DemoteRequest.h index 5fea7f47b30..6aba6cc8f47 100644 --- a/src/librbd/journal/DemoteRequest.h +++ b/src/librbd/journal/DemoteRequest.h @@ -4,7 +4,7 @@ #ifndef CEPH_LIBRBD_JOURNAL_DEMOTE_REQUEST_H #define CEPH_LIBRBD_JOURNAL_DEMOTE_REQUEST_H -#include "common/Mutex.h" +#include "common/ceph_mutex.h" #include "cls/journal/cls_journal_types.h" #include "journal/Future.h" #include "librbd/journal/Types.h" @@ -69,7 +69,7 @@ private: Journaler *m_journaler = nullptr; int m_ret_val = 0; - Mutex m_lock; + ceph::mutex m_lock; ImageClientMeta m_client_meta; uint64_t m_tag_tid = 0; TagData m_tag_data; diff --git a/src/librbd/journal/OpenRequest.cc b/src/librbd/journal/OpenRequest.cc index a5178de804c..e0cde38d0c3 100644 --- a/src/librbd/journal/OpenRequest.cc +++ b/src/librbd/journal/OpenRequest.cc @@ -25,7 +25,7 @@ using librbd::util::create_context_callback; using util::C_DecodeTags; template <typename I> -OpenRequest<I>::OpenRequest(I *image_ctx, Journaler *journaler, Mutex *lock, +OpenRequest<I>::OpenRequest(I *image_ctx, Journaler *journaler, ceph::mutex *lock, journal::ImageClientMeta *client_meta, uint64_t *tag_tid, journal::TagData *tag_data, Context *on_finish) @@ -97,7 +97,7 @@ void OpenRequest<I>::handle_init(int r) { m_tag_class = image_client_meta->tag_class; { - Mutex::Locker locker(*m_lock); + std::lock_guard locker{*m_lock}; *m_client_meta = *image_client_meta; } diff --git a/src/librbd/journal/OpenRequest.h b/src/librbd/journal/OpenRequest.h index f71d8c53676..0f10bccf1ad 100644 --- a/src/librbd/journal/OpenRequest.h +++ b/src/librbd/journal/OpenRequest.h @@ -4,11 +4,11 @@ #ifndef CEPH_LIBRBD_JOURNAL_OPEN_REQUEST_H #define CEPH_LIBRBD_JOURNAL_OPEN_REQUEST_H +#include "common/ceph_mutex.h" #include "include/int_types.h" #include "librbd/journal/TypeTraits.h" struct Context; -struct Mutex; namespace librbd { @@ -25,14 +25,14 @@ public: typedef typename TypeTraits<ImageCtxT>::Journaler Journaler; static OpenRequest* create(ImageCtxT *image_ctx, Journaler *journaler, - Mutex *lock, journal::ImageClientMeta *client_meta, + ceph::mutex *lock, journal::ImageClientMeta *client_meta, uint64_t *tag_tid, journal::TagData *tag_data, Context *on_finish) { return new OpenRequest(image_ctx, journaler, lock, client_meta, tag_tid, tag_data, on_finish); } - OpenRequest(ImageCtxT *image_ctx, Journaler *journaler, Mutex *lock, + OpenRequest(ImageCtxT *image_ctx, Journaler *journaler, ceph::mutex *lock, journal::ImageClientMeta *client_meta, uint64_t *tag_tid, journal::TagData *tag_data, Context *on_finish); @@ -59,7 +59,7 @@ private: ImageCtxT *m_image_ctx; Journaler *m_journaler; - Mutex *m_lock; + ceph::mutex *m_lock; journal::ImageClientMeta *m_client_meta; uint64_t *m_tag_tid; journal::TagData *m_tag_data; diff --git a/src/librbd/journal/PromoteRequest.cc b/src/librbd/journal/PromoteRequest.cc index 22dc83a32d8..703a8a075bc 100644 --- a/src/librbd/journal/PromoteRequest.cc +++ b/src/librbd/journal/PromoteRequest.cc @@ -26,7 +26,7 @@ using librbd::util::create_context_callback; template <typename I> PromoteRequest<I>::PromoteRequest(I *image_ctx, bool force, Context *on_finish) : m_image_ctx(image_ctx), m_force(force), m_on_finish(on_finish), - m_lock("PromoteRequest::m_lock") { + m_lock(ceph::make_mutex("PromoteRequest::m_lock")) { } template <typename I> diff --git a/src/librbd/journal/PromoteRequest.h b/src/librbd/journal/PromoteRequest.h index 0d01f596108..f6258066e7e 100644 --- a/src/librbd/journal/PromoteRequest.h +++ b/src/librbd/journal/PromoteRequest.h @@ -5,7 +5,7 @@ #define CEPH_LIBRBD_JOURNAL_PROMOTE_REQUEST_H #include "include/int_types.h" -#include "common/Mutex.h" +#include "common/ceph_mutex.h" #include "cls/journal/cls_journal_types.h" #include "journal/Future.h" #include "librbd/journal/Types.h" @@ -71,7 +71,7 @@ private: Journaler *m_journaler = nullptr; int m_ret_val = 0; - Mutex m_lock; + ceph::mutex m_lock; ImageClientMeta m_client_meta; uint64_t m_tag_tid = 0; TagData m_tag_data; diff --git a/src/librbd/journal/RemoveRequest.h b/src/librbd/journal/RemoveRequest.h index 594e62d5eb8..13dff87a08e 100644 --- a/src/librbd/journal/RemoveRequest.h +++ b/src/librbd/journal/RemoveRequest.h @@ -8,7 +8,6 @@ #include "include/buffer.h" #include "include/rados/librados.hpp" #include "include/rbd/librbd.hpp" -#include "common/Mutex.h" #include "librbd/ImageCtx.h" #include "journal/Journaler.h" #include "librbd/journal/TypeTraits.h" @@ -58,7 +57,7 @@ private: CephContext *m_cct; Journaler *m_journaler; SafeTimer *m_timer; - Mutex *m_timer_lock; + ceph::mutex *m_timer_lock; int m_r_saved; void stat_journal(); diff --git a/src/librbd/journal/Replay.cc b/src/librbd/journal/Replay.cc index 8f850ab5369..d2d71754559 100644 --- a/src/librbd/journal/Replay.cc +++ b/src/librbd/journal/Replay.cc @@ -118,7 +118,7 @@ struct ExecuteOp : public Context { } ldout(cct, 20) << ": ExecuteOp::" << __func__ << dendl; - RWLock::RLocker owner_locker(image_ctx.owner_lock); + std::shared_lock owner_locker{image_ctx.owner_lock}; if (image_ctx.exclusive_lock == nullptr || !image_ctx.exclusive_lock->accept_ops()) { @@ -173,7 +173,7 @@ struct C_RefreshIfRequired : public Context { template <typename I> Replay<I>::Replay(I &image_ctx) - : m_image_ctx(image_ctx), m_lock("Replay<I>::m_lock") { + : m_image_ctx(image_ctx) { } template <typename I> @@ -206,7 +206,7 @@ void Replay<I>::process(const EventEntry &event_entry, on_ready = util::create_async_context_callback(m_image_ctx, on_ready); - RWLock::RLocker owner_lock(m_image_ctx.owner_lock); + std::shared_lock owner_lock{m_image_ctx.owner_lock}; if (m_image_ctx.exclusive_lock == nullptr || !m_image_ctx.exclusive_lock->accept_ops()) { ldout(cct, 5) << ": lost exclusive lock -- skipping event" << dendl; @@ -229,7 +229,7 @@ void Replay<I>::shut_down(bool cancel_ops, Context *on_finish) { m_image_ctx, on_finish); { - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; // safely commit any remaining AIO modify operations if ((m_in_flight_aio_flush + m_in_flight_aio_modify) != 0) { @@ -270,7 +270,7 @@ void Replay<I>::shut_down(bool cancel_ops, Context *on_finish) { // execute the following outside of lock scope if (flush_comp != nullptr) { - RWLock::RLocker owner_locker(m_image_ctx.owner_lock); + std::shared_lock owner_locker{m_image_ctx.owner_lock}; io::ImageRequest<I>::aio_flush(&m_image_ctx, flush_comp, io::FLUSH_SOURCE_INTERNAL, {}); } @@ -283,7 +283,7 @@ template <typename I> void Replay<I>::flush(Context *on_finish) { io::AioCompletion *aio_comp; { - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; aio_comp = create_aio_flush_completion( util::create_async_context_callback(m_image_ctx, on_finish)); if (aio_comp == nullptr) { @@ -291,7 +291,7 @@ void Replay<I>::flush(Context *on_finish) { } } - RWLock::RLocker owner_locker(m_image_ctx.owner_lock); + std::shared_lock owner_locker{m_image_ctx.owner_lock}; io::ImageRequest<I>::aio_flush(&m_image_ctx, aio_comp, io::FLUSH_SOURCE_INTERNAL, {}); } @@ -301,7 +301,7 @@ void Replay<I>::replay_op_ready(uint64_t op_tid, Context *on_resume) { CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": op_tid=" << op_tid << dendl; - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; auto op_it = m_op_events.find(op_tid); ceph_assert(op_it != m_op_events.end()); @@ -357,9 +357,9 @@ void Replay<I>::handle_event(const journal::AioDiscardEvent &event, } if (flush_required) { - m_lock.Lock(); + m_lock.lock(); auto flush_comp = create_aio_flush_completion(nullptr); - m_lock.Unlock(); + m_lock.unlock(); if (flush_comp != nullptr) { io::ImageRequest<I>::aio_flush(&m_image_ctx, flush_comp, @@ -391,9 +391,9 @@ void Replay<I>::handle_event(const journal::AioWriteEvent &event, } if (flush_required) { - m_lock.Lock(); + m_lock.lock(); auto flush_comp = create_aio_flush_completion(nullptr); - m_lock.Unlock(); + m_lock.unlock(); if (flush_comp != nullptr) { io::ImageRequest<I>::aio_flush(&m_image_ctx, flush_comp, @@ -410,7 +410,7 @@ void Replay<I>::handle_event(const journal::AioFlushEvent &event, io::AioCompletion *aio_comp; { - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; aio_comp = create_aio_flush_completion(on_safe); } @@ -444,9 +444,9 @@ void Replay<I>::handle_event(const journal::AioWriteSameEvent &event, } if (flush_required) { - m_lock.Lock(); + m_lock.lock(); auto flush_comp = create_aio_flush_completion(nullptr); - m_lock.Unlock(); + m_lock.unlock(); if (flush_comp != nullptr) { io::ImageRequest<I>::aio_flush(&m_image_ctx, flush_comp, @@ -478,9 +478,9 @@ void Replay<I>::handle_event(const journal::AioWriteSameEvent &event, } if (flush_required) { - m_lock.Lock(); + m_lock.lock(); auto flush_comp = create_aio_flush_completion(nullptr); - m_lock.Unlock(); + m_lock.unlock(); io::ImageRequest<I>::aio_flush(&m_image_ctx, flush_comp, io::FLUSH_SOURCE_INTERNAL, {}); @@ -499,7 +499,7 @@ void Replay<I>::handle_event(const journal::OpFinishEvent &event, Context *on_op_complete = nullptr; Context *on_op_finish_event = nullptr; { - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; auto op_it = m_op_events.find(event.op_tid); if (op_it == m_op_events.end()) { ldout(cct, 10) << ": unable to locate associated op: assuming previously " @@ -548,7 +548,7 @@ void Replay<I>::handle_event(const journal::SnapCreateEvent &event, CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": Snap create event" << dendl; - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; OpEvent *op_event; Context *on_op_complete = create_op_context_callback(event.op_tid, on_ready, on_safe, &op_event); @@ -577,7 +577,7 @@ void Replay<I>::handle_event(const journal::SnapRemoveEvent &event, CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": Snap remove event" << dendl; - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; OpEvent *op_event; Context *on_op_complete = create_op_context_callback(event.op_tid, on_ready, on_safe, &op_event); @@ -601,7 +601,7 @@ void Replay<I>::handle_event(const journal::SnapRenameEvent &event, CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": Snap rename event" << dendl; - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; OpEvent *op_event; Context *on_op_complete = create_op_context_callback(event.op_tid, on_ready, on_safe, &op_event); @@ -625,7 +625,7 @@ void Replay<I>::handle_event(const journal::SnapProtectEvent &event, CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": Snap protect event" << dendl; - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; OpEvent *op_event; Context *on_op_complete = create_op_context_callback(event.op_tid, on_ready, on_safe, &op_event); @@ -649,7 +649,7 @@ void Replay<I>::handle_event(const journal::SnapUnprotectEvent &event, CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": Snap unprotect event" << dendl; - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; OpEvent *op_event; Context *on_op_complete = create_op_context_callback(event.op_tid, on_ready, on_safe, &op_event); @@ -677,7 +677,7 @@ void Replay<I>::handle_event(const journal::SnapRollbackEvent &event, CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": Snap rollback start event" << dendl; - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; OpEvent *op_event; Context *on_op_complete = create_op_context_callback(event.op_tid, on_ready, on_safe, &op_event); @@ -699,7 +699,7 @@ void Replay<I>::handle_event(const journal::RenameEvent &event, CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": Rename event" << dendl; - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; OpEvent *op_event; Context *on_op_complete = create_op_context_callback(event.op_tid, on_ready, on_safe, &op_event); @@ -723,7 +723,7 @@ void Replay<I>::handle_event(const journal::ResizeEvent &event, CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": Resize start event" << dendl; - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; OpEvent *op_event; Context *on_op_complete = create_op_context_callback(event.op_tid, on_ready, on_safe, &op_event); @@ -748,7 +748,7 @@ void Replay<I>::handle_event(const journal::FlattenEvent &event, CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": Flatten start event" << dendl; - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; OpEvent *op_event; Context *on_op_complete = create_op_context_callback(event.op_tid, on_ready, on_safe, &op_event); @@ -781,7 +781,7 @@ void Replay<I>::handle_event(const journal::SnapLimitEvent &event, CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": Snap limit event" << dendl; - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; OpEvent *op_event; Context *on_op_complete = create_op_context_callback(event.op_tid, on_ready, on_safe, &op_event); @@ -805,7 +805,7 @@ void Replay<I>::handle_event(const journal::UpdateFeaturesEvent &event, CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": Update features event" << dendl; - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; OpEvent *op_event; Context *on_op_complete = create_op_context_callback(event.op_tid, on_ready, on_safe, &op_event); @@ -830,7 +830,7 @@ void Replay<I>::handle_event(const journal::MetadataSetEvent &event, CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": Metadata set event" << dendl; - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; OpEvent *op_event; Context *on_op_complete = create_op_context_callback(event.op_tid, on_ready, on_safe, &op_event); @@ -852,7 +852,7 @@ void Replay<I>::handle_event(const journal::MetadataRemoveEvent &event, CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": Metadata remove event" << dendl; - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; OpEvent *op_event; Context *on_op_complete = create_op_context_callback(event.op_tid, on_ready, on_safe, &op_event); @@ -883,7 +883,7 @@ void Replay<I>::handle_event(const journal::UnknownEvent &event, template <typename I> void Replay<I>::handle_aio_modify_complete(Context *on_ready, Context *on_safe, int r, std::set<int> &filters) { - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; CephContext *cct = m_image_ctx.cct; ldout(cct, 20) << ": on_ready=" << on_ready << ", " << "on_safe=" << on_safe << ", r=" << r << dendl; @@ -918,7 +918,7 @@ void Replay<I>::handle_aio_flush_complete(Context *on_flush_safe, Context *on_aio_ready = nullptr; Context *on_flush = nullptr; { - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; ceph_assert(m_in_flight_aio_flush > 0); ceph_assert(m_in_flight_aio_modify >= on_safe_ctxs.size()); --m_in_flight_aio_flush; @@ -972,7 +972,7 @@ Context *Replay<I>::create_op_context_callback(uint64_t op_tid, return nullptr; } - ceph_assert(m_lock.is_locked()); + ceph_assert(ceph_mutex_is_locked(m_lock)); if (m_op_events.count(op_tid) != 0) { lderr(cct) << ": duplicate op tid detected: " << op_tid << dendl; @@ -1001,7 +1001,7 @@ void Replay<I>::handle_op_complete(uint64_t op_tid, int r) { OpEvent op_event; bool shutting_down = false; { - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; auto op_it = m_op_events.find(op_tid); ceph_assert(op_it != m_op_events.end()); @@ -1049,7 +1049,7 @@ void Replay<I>::handle_op_complete(uint64_t op_tid, int r) { // dropped -- handle if pending Context *on_flush = nullptr; { - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; ceph_assert(m_in_flight_op_events > 0); --m_in_flight_op_events; if (m_in_flight_op_events == 0 && @@ -1069,7 +1069,7 @@ Replay<I>::create_aio_modify_completion(Context *on_ready, io::aio_type_t aio_type, bool *flush_required, std::set<int> &&filters) { - Mutex::Locker locker(m_lock); + std::lock_guard locker{m_lock}; CephContext *cct = m_image_ctx.cct; ceph_assert(m_on_aio_ready == nullptr); @@ -1117,7 +1117,7 @@ Replay<I>::create_aio_modify_completion(Context *on_ready, template <typename I> io::AioCompletion *Replay<I>::create_aio_flush_completion(Context *on_safe) { - ceph_assert(m_lock.is_locked()); + ceph_assert(ceph_mutex_is_locked(m_lock)); CephContext *cct = m_image_ctx.cct; if (m_shut_down) { @@ -1143,9 +1143,9 @@ template <typename I> bool Replay<I>::clipped_io(uint64_t image_offset, io::AioCompletion *aio_comp) { CephContext *cct = m_image_ctx.cct; - m_image_ctx.image_lock.get_read(); + m_image_ctx.image_lock.lock_shared(); size_t image_size = m_image_ctx.size; - m_image_ctx.image_lock.put_read(); + m_image_ctx.image_lock.unlock_shared(); if (image_offset >= image_size) { // rbd-mirror image sync might race an IO event w/ associated resize between diff --git a/src/librbd/journal/Replay.h b/src/librbd/journal/Replay.h index 6e058ddb35b..038601833cd 100644 --- a/src/librbd/journal/Replay.h +++ b/src/librbd/journal/Replay.h @@ -7,7 +7,7 @@ #include "include/int_types.h" #include "include/buffer_fwd.h" #include "include/Context.h" -#include "common/Mutex.h" +#include "common/ceph_mutex.h" #include "librbd/io/Types.h" #include "librbd/journal/Types.h" #include <boost/variant.hpp> @@ -119,7 +119,7 @@ private: ImageCtxT &m_image_ctx; - Mutex m_lock; + ceph::mutex m_lock = ceph::make_mutex("Replay<I>::m_lock"); uint64_t m_in_flight_aio_flush = 0; uint64_t m_in_flight_aio_modify = 0; diff --git a/src/librbd/journal/ResetRequest.h b/src/librbd/journal/ResetRequest.h index 9cc8e2e437c..44f5ac8a6bd 100644 --- a/src/librbd/journal/ResetRequest.h +++ b/src/librbd/journal/ResetRequest.h @@ -8,7 +8,6 @@ #include "include/buffer.h" #include "include/rados/librados.hpp" #include "include/rbd/librbd.hpp" -#include "common/Mutex.h" #include "librbd/journal/TypeTraits.h" #include <string> diff --git a/src/librbd/journal/Utils.cc b/src/librbd/journal/Utils.cc index 1721a9b2c94..231bcae2d32 100644 --- a/src/librbd/journal/Utils.cc +++ b/src/librbd/journal/Utils.cc @@ -32,7 +32,7 @@ int C_DecodeTag::process(int r) { return r; } - Mutex::Locker locker(*lock); + std::lock_guard locker{*lock}; *tag_tid = tag.tid; auto data_it = tag.data.cbegin(); @@ -64,7 +64,7 @@ int C_DecodeTags::process(int r) { return -ENOENT; } - Mutex::Locker locker(*lock); + std::lock_guard locker{*lock}; *tag_tid = tags.back().tid; auto data_it = tags.back().data.cbegin(); r = C_DecodeTag::decode(&data_it, tag_data); diff --git a/src/librbd/journal/Utils.h b/src/librbd/journal/Utils.h index 63d37c03726..d22044d1037 100644 --- a/src/librbd/journal/Utils.h +++ b/src/librbd/journal/Utils.h @@ -10,7 +10,6 @@ #include <list> struct CephContext; -struct Mutex; namespace librbd { namespace journal { @@ -21,14 +20,14 @@ namespace util { struct C_DecodeTag : public Context { CephContext *cct; - Mutex *lock; + ceph::mutex *lock; uint64_t *tag_tid; TagData *tag_data; Context *on_finish; cls::journal::Tag tag; - C_DecodeTag(CephContext *cct, Mutex *lock, uint64_t *tag_tid, + C_DecodeTag(CephContext *cct, ceph::mutex *lock, uint64_t *tag_tid, TagData *tag_data, Context *on_finish) : cct(cct), lock(lock), tag_tid(tag_tid), tag_data(tag_data), on_finish(on_finish) { @@ -51,14 +50,14 @@ struct C_DecodeTags : public Context { typedef std::list<cls::journal::Tag> Tags; CephContext *cct; - Mutex *lock; + ceph::mutex *lock; uint64_t *tag_tid; TagData *tag_data; Context *on_finish; Tags tags; - C_DecodeTags(CephContext *cct, Mutex *lock, uint64_t *tag_tid, + C_DecodeTags(CephContext *cct, ceph::mutex *lock, uint64_t *tag_tid, TagData *tag_data, Context *on_finish) : cct(cct), lock(lock), tag_tid(tag_tid), tag_data(tag_data), on_finish(on_finish) { |