* s/Formatter/ceph::Formatter/ in tools/rbd_mirror/ImageSyncThrottler,
as we cannot rely on `using ceph` or `using ceph::Formatter` in
some other included header files.
Signed-off-by: Kefu Chai <kchai@redhat.com>
as we cannot create a `smart_pointer<ceph::mutex>` due to limitation of
`ceph::make_mutex()`, we need to refactor `TestObjectRecorder` to remove
its `TearDown()` method, as when `TearDown()` is called, all local
variables have been destroyed, including the `ceph::mutex` instances. so
we need to introduce a helper of `ObjectRecorderFlusher`, to flush the
objects before `mutex` instances are destroyed. to simplify the
interfaces, it flushes in its dtor. so its lifecycle should be shorter
than those of mutexes. that's why, mutexes are created before `flusher`.
Signed-off-by: Kefu Chai <kchai@redhat.com>
* FutureImpl::m_lock is an exception. as, before this change, the lock
was initialized like `m_lock("FutureImpl::m_lock", false, false)`, see
the declaration of
`Mutex(const std::string &n, bool r = false, bool ld=true, bool bt=false)`
so `m_lock` is actually not using the extra features offered by
`Mutex` like runtime lockdeps check. and `mutex_debugging_base` does
not allow us to disable lockdeps individually. but it does use the `is_locked()`
method. so instead of using `ceph::mutex` directly, a cutomized
`ceph::mutex` is added for `CEPH_DEBUG_MUTEX` build.
Signed-off-by: Kefu Chai <kchai@redhat.com>
so we can disable lockdep when constructing a ceph::mutex. otherwise
it's difficult to use the locks from standard library and to use
`ceph_assert(ceph_mutex_is_locked(lock))` at the same time.
Signed-off-by: Kefu Chai <kchai@redhat.com>
there is chance that we want to disable lockdep, so we shold pass
`no_lockdep` down to `try_lock()` in `lock()`.
Signed-off-by: Kefu Chai <kchai@redhat.com>
we have caller sites like
ceph_assert(!client->client_lock.is_locked_by_me())
in `src/client/Client.cc` and `src/librados/RadosClient.cc`.
Signed-off-by: Kefu Chai <kchai@redhat.com>
so RWLock can be used with std::shared_lock,
rgw is using RWLock'prioritize_write feature, which is not offered by
std::shared_mutex, but we want to unify the way we use mutex, so add
these helper functions.
Signed-off-by: Kefu Chai <kchai@redhat.com>