Commit Graph

100471 Commits

Author SHA1 Message Date
Kefu Chai
757796c370 test/librados: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
067ab99798 test/compressor: do not include unused header
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
1af73d2a70 test/common/Throttle: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
8b6f0977a1 common/obj_bencher: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
a1a25d2d4f auth: remove unused forwarde declaration
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
e3e65af172 test/librados_test_stub: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
af0e1b4ec6 libcephfs: remove unused #include
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
778f96af53 cls_kvs: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
108fc27d78 crush: remove unused #include
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
15f13561d1 fusetrace: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
5ca9df3bb7 tools/rbd_nbd: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
6e7cfc1e30 tools/rbd_ggate: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
a7ac68d4fd tools/rbd: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
7e6e503627 tools/ceph_dedup_tool: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
85ab02b680 test/xattr_bench: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
251845cbfa test/test_snap_mapper: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
871ba4ebf3 test/osd: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
816709cda7 test/omap_bench: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
bfb8c741cd test/msgr: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
60de46ef04 test/admin_socket: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
b1f5565c2f kv: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
de68b2cbbc tools/rados: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
42f6597231 tools/immutable_object_cache: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
1fb8a60f23 tools/cephfs: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
4b64f16fe4 test/os/filestore: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
bf0142c6c9 tools/rbd_mirror: s/Mutex/ceph::Formatter/
* 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>
2019-08-03 11:27:20 +08:00
Kefu Chai
34cb0ebe5d test/perf_local: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:20 +08:00
Kefu Chai
9e1e84d9f7 test/osdc: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
eb1dce5e4c test/objectstore: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
ed5fc085b2 test/mon: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
792d6c53fe test/librbd: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
efee3ae5fb test/journal: s/Mutex/ceph::mutex/
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>
2019-08-03 11:27:19 +08:00
Kefu Chai
02292616a3 rgw: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
a79837bcee librbd: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
f39b32ebfa journal: s/Mutex/ceph::mutex/
* 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>
2019-08-03 11:27:19 +08:00
Kefu Chai
2dbd31eb0b common/mutex_debug: add lockdep parameter to mutex's ctor
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>
2019-08-03 11:27:19 +08:00
Kefu Chai
bb2a97000b common/mutex_debug.h: pass "no_lockdep" to try_lock()
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>
2019-08-03 11:27:19 +08:00
Kefu Chai
2507fb64c3 include/Context: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
0a75f504cc erasure-code: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
307ccc42f0 common/ceph_mutex: add more ceph_mutex_is_*() helpers
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>
2019-08-03 11:27:19 +08:00
Kefu Chai
cc67c34a9e common/ceph_mutex: improve ceph::shared_mutex
add helpers for supporting `ceph_mutex_is_locked()` and
`ceph_mutex_is_wlocked()` macros

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
99f31705b6 common/Timer: add necessary #include
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
3f612c45e3 common/RWLock: add RWLock::{lock,unlock}_shared()
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>
2019-08-03 11:27:19 +08:00
Kefu Chai
d5cbb94bcb common: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
79a722402a common/HeartbeatMap.cc: include necessary header
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
f4ac81502a common/Cond.h: include necessary header
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
6e6faf080a cls/rgw: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
675606bf71 mds: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:19 +08:00
Kefu Chai
20b1ac6e09 osdc: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:18 +08:00
Kefu Chai
35d0ce394f osd: s/Mutex/ceph::mutex/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-03 11:27:18 +08:00