summaryrefslogtreecommitdiffstats
path: root/src/journal/JournalPlayer.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/JournalPlayer.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/JournalPlayer.cc')
-rw-r--r--src/journal/JournalPlayer.cc74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/journal/JournalPlayer.cc b/src/journal/JournalPlayer.cc
index 51180218080..89952e636a4 100644
--- a/src/journal/JournalPlayer.cc
+++ b/src/journal/JournalPlayer.cc
@@ -79,19 +79,19 @@ JournalPlayer::JournalPlayer(librados::IoCtx &ioctx,
}
JournalPlayer::~JournalPlayer() {
- assert(m_async_op_tracker.empty());
+ ceph_assert(m_async_op_tracker.empty());
{
Mutex::Locker locker(m_lock);
- assert(m_shut_down);
- assert(m_fetch_object_numbers.empty());
- assert(!m_watch_scheduled);
+ ceph_assert(m_shut_down);
+ ceph_assert(m_fetch_object_numbers.empty());
+ ceph_assert(!m_watch_scheduled);
}
m_replay_handler->put();
}
void JournalPlayer::prefetch() {
Mutex::Locker locker(m_lock);
- assert(m_state == STATE_INIT);
+ ceph_assert(m_state == STATE_INIT);
m_state = STATE_PREFETCH;
m_active_set = m_journal_metadata->get_active_set();
@@ -104,7 +104,7 @@ void JournalPlayer::prefetch() {
// active set)
std::map<uint8_t, uint64_t> splay_offset_to_objects;
for (auto &position : m_commit_positions) {
- assert(splay_offset_to_objects.count(position.first) == 0);
+ ceph_assert(splay_offset_to_objects.count(position.first) == 0);
splay_offset_to_objects[position.first] = position.second.object_number;
}
@@ -141,7 +141,7 @@ void JournalPlayer::shut_down(Context *on_finish) {
ldout(m_cct, 20) << __func__ << dendl;
Mutex::Locker locker(m_lock);
- assert(!m_shut_down);
+ ceph_assert(!m_shut_down);
m_shut_down = true;
m_watch_enabled = false;
@@ -184,7 +184,7 @@ bool JournalPlayer::try_pop_front(Entry *entry, uint64_t *commit_tid) {
}
ObjectPlayerPtr object_player = get_object_player();
- assert(object_player && !object_player->empty());
+ ceph_assert(object_player && !object_player->empty());
object_player->front(entry);
object_player->pop_front();
@@ -215,7 +215,7 @@ void JournalPlayer::process_state(uint64_t object_number, int r) {
ldout(m_cct, 10) << __func__ << ": object_num=" << object_number << ", "
<< "r=" << r << dendl;
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
if (r >= 0) {
switch (m_state) {
case STATE_PREFETCH:
@@ -244,7 +244,7 @@ void JournalPlayer::process_state(uint64_t object_number, int r) {
int JournalPlayer::process_prefetch(uint64_t object_number) {
ldout(m_cct, 10) << __func__ << ": object_num=" << object_number << dendl;
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
uint8_t splay_width = m_journal_metadata->get_splay_width();
uint8_t splay_offset = object_number % splay_width;
@@ -256,7 +256,7 @@ int JournalPlayer::process_prefetch(uint64_t object_number) {
}
bool prefetch_complete = false;
- assert(m_object_players.count(splay_offset) == 1);
+ ceph_assert(m_object_players.count(splay_offset) == 1);
ObjectPlayerPtr object_player = m_object_players[splay_offset];
// prefetch in-order since a newer splay object could prefetch first
@@ -349,7 +349,7 @@ int JournalPlayer::process_prefetch(uint64_t object_number) {
int JournalPlayer::process_playback(uint64_t object_number) {
ldout(m_cct, 10) << __func__ << ": object_num=" << object_number << dendl;
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
if (verify_playback_ready()) {
notify_entries_available();
@@ -360,7 +360,7 @@ int JournalPlayer::process_playback(uint64_t object_number) {
}
bool JournalPlayer::is_object_set_ready() const {
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
if (m_watch_scheduled || !m_fetch_object_numbers.empty()) {
ldout(m_cct, 20) << __func__ << ": waiting for in-flight fetch" << dendl;
return false;
@@ -370,7 +370,7 @@ bool JournalPlayer::is_object_set_ready() const {
}
bool JournalPlayer::verify_playback_ready() {
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
while (true) {
if (!is_object_set_ready()) {
@@ -379,7 +379,7 @@ bool JournalPlayer::verify_playback_ready() {
}
ObjectPlayerPtr object_player = get_object_player();
- assert(object_player);
+ ceph_assert(object_player);
uint64_t object_num = object_player->get_object_number();
// Verify is the active object player has another entry available
@@ -428,7 +428,7 @@ bool JournalPlayer::verify_playback_ready() {
ldout(m_cct, 20) << __func__ << ": "
<< "object_num=" << object_num << ", "
<< "entry: " << entry << dendl;
- assert(entry.get_tag_tid() == *m_active_tag_tid);
+ ceph_assert(entry.get_tag_tid() == *m_active_tag_tid);
return true;
}
} else {
@@ -473,7 +473,7 @@ bool JournalPlayer::verify_playback_ready() {
}
void JournalPlayer::prune_tag(uint64_t tag_tid) {
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
ldout(m_cct, 10) << __func__ << ": pruning remaining entries for tag "
<< tag_tid << dendl;
@@ -517,8 +517,8 @@ void JournalPlayer::prune_tag(uint64_t tag_tid) {
}
void JournalPlayer::prune_active_tag(const boost::optional<uint64_t>& tag_tid) {
- assert(m_lock.is_locked());
- assert(m_active_tag_tid);
+ ceph_assert(m_lock.is_locked());
+ ceph_assert(m_active_tag_tid);
uint64_t active_tag_tid = *m_active_tag_tid;
if (tag_tid) {
@@ -531,29 +531,29 @@ void JournalPlayer::prune_active_tag(const boost::optional<uint64_t>& tag_tid) {
}
ObjectPlayerPtr JournalPlayer::get_object_player() const {
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
SplayedObjectPlayers::const_iterator it = m_object_players.find(
m_splay_offset);
- assert(it != m_object_players.end());
+ ceph_assert(it != m_object_players.end());
return it->second;
}
ObjectPlayerPtr JournalPlayer::get_object_player(uint64_t object_number) const {
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
uint8_t splay_width = m_journal_metadata->get_splay_width();
uint8_t splay_offset = object_number % splay_width;
auto splay_it = m_object_players.find(splay_offset);
- assert(splay_it != m_object_players.end());
+ ceph_assert(splay_it != m_object_players.end());
ObjectPlayerPtr object_player = splay_it->second;
- assert(object_player->get_object_number() == object_number);
+ ceph_assert(object_player->get_object_number() == object_number);
return object_player;
}
void JournalPlayer::advance_splay_object() {
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
++m_splay_offset;
m_splay_offset %= m_journal_metadata->get_splay_width();
m_watch_step = WATCH_STEP_FETCH_CURRENT;
@@ -562,8 +562,8 @@ void JournalPlayer::advance_splay_object() {
}
bool JournalPlayer::remove_empty_object_player(const ObjectPlayerPtr &player) {
- assert(m_lock.is_locked());
- assert(!m_watch_scheduled);
+ ceph_assert(m_lock.is_locked());
+ ceph_assert(!m_watch_scheduled);
uint8_t splay_width = m_journal_metadata->get_splay_width();
uint64_t object_set = player->get_object_number() / splay_width;
@@ -596,7 +596,7 @@ bool JournalPlayer::remove_empty_object_player(const ObjectPlayerPtr &player) {
}
void JournalPlayer::fetch(uint64_t object_num) {
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
ObjectPlayerPtr object_player(new ObjectPlayer(
m_ioctx, m_object_oid_prefix, object_num, m_journal_metadata->get_timer(),
@@ -609,11 +609,11 @@ void JournalPlayer::fetch(uint64_t object_num) {
}
void JournalPlayer::fetch(const ObjectPlayerPtr &object_player) {
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
uint64_t object_num = object_player->get_object_number();
std::string oid = utils::get_object_name(m_object_oid_prefix, object_num);
- assert(m_fetch_object_numbers.count(object_num) == 0);
+ ceph_assert(m_fetch_object_numbers.count(object_num) == 0);
m_fetch_object_numbers.insert(object_num);
ldout(m_cct, 10) << __func__ << ": " << oid << dendl;
@@ -628,7 +628,7 @@ void JournalPlayer::handle_fetched(uint64_t object_num, int r) {
<< ": r=" << r << dendl;
Mutex::Locker locker(m_lock);
- assert(m_fetch_object_numbers.count(object_num) == 1);
+ ceph_assert(m_fetch_object_numbers.count(object_num) == 1);
m_fetch_object_numbers.erase(object_num);
if (m_shut_down) {
@@ -644,7 +644,7 @@ void JournalPlayer::handle_fetched(uint64_t object_num, int r) {
void JournalPlayer::refetch(bool immediate) {
ldout(m_cct, 10) << __func__ << dendl;
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
m_handler_notified = false;
// if watching the object, handle the periodic re-fetch
@@ -665,7 +665,7 @@ void JournalPlayer::refetch(bool immediate) {
void JournalPlayer::schedule_watch(bool immediate) {
ldout(m_cct, 10) << __func__ << dendl;
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
if (m_watch_scheduled) {
return;
}
@@ -727,7 +727,7 @@ void JournalPlayer::schedule_watch(bool immediate) {
void JournalPlayer::handle_watch(uint64_t object_num, int r) {
ldout(m_cct, 10) << __func__ << ": r=" << r << dendl;
Mutex::Locker locker(m_lock);
- assert(m_watch_scheduled);
+ ceph_assert(m_watch_scheduled);
m_watch_scheduled = false;
if (m_shut_down || r == -ECANCELED) {
@@ -761,7 +761,7 @@ void JournalPlayer::handle_watch_assert_active(int r) {
ldout(m_cct, 10) << __func__ << ": r=" << r << dendl;
Mutex::Locker locker(m_lock);
- assert(m_watch_scheduled);
+ ceph_assert(m_watch_scheduled);
m_watch_scheduled = false;
if (r == -ESTALE) {
@@ -780,7 +780,7 @@ void JournalPlayer::handle_watch_assert_active(int r) {
}
void JournalPlayer::notify_entries_available() {
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
if (m_handler_notified) {
return;
}
@@ -792,7 +792,7 @@ void JournalPlayer::notify_entries_available() {
}
void JournalPlayer::notify_complete(int r) {
- assert(m_lock.is_locked());
+ ceph_assert(m_lock.is_locked());
m_handler_notified = true;
ldout(m_cct, 10) << __func__ << ": replay complete: r=" << r << dendl;