summaryrefslogtreecommitdiffstats
path: root/src/journal/Journaler.cc
diff options
context:
space:
mode:
authorAdam C. Emerson <aemerson@redhat.com>2018-08-23 17:24:01 +0200
committerAdam C. Emerson <aemerson@redhat.com>2018-08-27 15:35:43 +0200
commit8c52b89356d444093ea07290498f47fba2567bb3 (patch)
tree2deb3d4bd41e90af728371546765fd7a252103bb /src/journal/Journaler.cc
parentglobal: Use ceph_assert for asserts. (diff)
downloadceph-8c52b89356d444093ea07290498f47fba2567bb3.tar.xz
ceph-8c52b89356d444093ea07290498f47fba2567bb3.zip
journal: Use ceph_assert for asserts.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Diffstat (limited to 'src/journal/Journaler.cc')
-rw-r--r--src/journal/Journaler.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/journal/Journaler.cc b/src/journal/Journaler.cc
index 5b580c50005..65d32de3d1e 100644
--- a/src/journal/Journaler.cc
+++ b/src/journal/Journaler.cc
@@ -107,7 +107,7 @@ void Journaler::set_up(ContextWQ *work_queue, SafeTimer *timer,
Journaler::~Journaler() {
if (m_metadata != nullptr) {
- assert(!m_metadata->is_initialized());
+ ceph_assert(!m_metadata->is_initialized());
if (!m_initialized) {
// never initialized -- ensure any in-flight ops are complete
// since we wouldn't expect shut_down to be invoked
@@ -116,9 +116,9 @@ Journaler::~Journaler() {
m_metadata->put();
m_metadata = nullptr;
}
- assert(m_trimmer == nullptr);
- assert(m_player == nullptr);
- assert(m_recorder == nullptr);
+ ceph_assert(m_trimmer == nullptr);
+ ceph_assert(m_player == nullptr);
+ ceph_assert(m_recorder == nullptr);
delete m_threads;
m_threads = nullptr;
@@ -131,7 +131,7 @@ void Journaler::exists(Context *on_finish) const {
librados::AioCompletion *comp =
librados::Rados::aio_create_completion(on_finish, nullptr, rados_ctx_callback);
int r = m_header_ioctx.aio_operate(m_header_oid, comp, &op, nullptr);
- assert(r == 0);
+ ceph_assert(r == 0);
comp->release();
}
@@ -171,13 +171,13 @@ void Journaler::shut_down() {
}
void Journaler::shut_down(Context *on_finish) {
- assert(m_player == nullptr);
- assert(m_recorder == nullptr);
+ ceph_assert(m_player == nullptr);
+ ceph_assert(m_recorder == nullptr);
JournalMetadata *metadata = nullptr;
- assert(m_metadata != nullptr);
+ ceph_assert(m_metadata != nullptr);
std::swap(metadata, m_metadata);
- assert(metadata != nullptr);
+ ceph_assert(metadata != nullptr);
on_finish = new FunctionContext([metadata, on_finish](int r) {
metadata->put();
@@ -234,7 +234,7 @@ void Journaler::create(uint8_t order, uint8_t splay_width,
librados::AioCompletion *comp =
librados::Rados::aio_create_completion(on_finish, nullptr, rados_ctx_callback);
int r = m_header_ioctx.aio_operate(m_header_oid, comp, &op);
- assert(r == 0);
+ ceph_assert(r == 0);
comp->release();
}
@@ -244,7 +244,7 @@ void Journaler::remove(bool force, Context *on_finish) {
librados::AioCompletion *comp = librados::Rados::aio_create_completion(
on_finish, nullptr, utils::rados_ctx_callback);
r = m_header_ioctx.aio_remove(m_header_oid, comp);
- assert(r == 0);
+ ceph_assert(r == 0);
comp->release();
});
@@ -348,7 +348,7 @@ void Journaler::start_live_replay(ReplayHandler *replay_handler,
bool Journaler::try_pop_front(ReplayEntry *replay_entry,
uint64_t *tag_tid) {
- assert(m_player != nullptr);
+ ceph_assert(m_player != nullptr);
Entry entry;
uint64_t commit_tid;
@@ -371,9 +371,9 @@ void Journaler::stop_replay() {
void Journaler::stop_replay(Context *on_finish) {
JournalPlayer *player = nullptr;
- assert(m_player != nullptr);
+ ceph_assert(m_player != nullptr);
std::swap(player, m_player);
- assert(player != nullptr);
+ ceph_assert(player != nullptr);
on_finish = new FunctionContext([player, on_finish](int r) {
delete player;
@@ -393,7 +393,7 @@ void Journaler::committed(const Future &future) {
void Journaler::start_append(int flush_interval, uint64_t flush_bytes,
double flush_age) {
- assert(m_recorder == nullptr);
+ ceph_assert(m_recorder == nullptr);
// TODO verify active object set >= current replay object set
@@ -404,9 +404,9 @@ void Journaler::start_append(int flush_interval, uint64_t flush_bytes,
void Journaler::stop_append(Context *on_safe) {
JournalRecorder *recorder = nullptr;
- assert(m_recorder != nullptr);
+ ceph_assert(m_recorder != nullptr);
std::swap(recorder, m_recorder);
- assert(recorder != nullptr);
+ ceph_assert(recorder != nullptr);
on_safe = new FunctionContext([recorder, on_safe](int r) {
delete recorder;
@@ -434,14 +434,14 @@ void Journaler::flush_append(Context *on_safe) {
}
void Journaler::create_player(ReplayHandler *replay_handler) {
- assert(m_player == nullptr);
+ ceph_assert(m_player == nullptr);
m_player = new JournalPlayer(m_data_ioctx, m_object_oid_prefix, m_metadata,
replay_handler);
}
void Journaler::get_metadata(uint8_t *order, uint8_t *splay_width,
int64_t *pool_id) {
- assert(m_metadata != nullptr);
+ ceph_assert(m_metadata != nullptr);
*order = m_metadata->get_order();
*splay_width = m_metadata->get_splay_width();