Skip to content

Commit bec702d

Browse files
committed
common,osdc: remove obsolete ceph::mutex_debugging
Now that we confirm a lock is not held in mutex_debug::lock. Signed-off-by: Patrick Donnelly <[email protected]>
1 parent 69baa6d commit bec702d

File tree

3 files changed

+0
-20
lines changed

3 files changed

+0
-20
lines changed

src/common/ceph_mutex.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ namespace ceph {
8383
return {};
8484
}
8585

86-
static constexpr bool mutex_debugging = false;
8786
#define ceph_mutex_is_locked(m) true
8887
#define ceph_mutex_is_locked_by_me(m) true
8988
}
@@ -131,8 +130,6 @@ namespace ceph {
131130
return {std::forward<Args>(args)...};
132131
}
133132

134-
static constexpr bool mutex_debugging = true;
135-
136133
// debug methods
137134
#define ceph_mutex_is_locked(m) ((m).is_locked())
138135
#define ceph_mutex_is_not_locked(m) (!(m).is_locked())
@@ -186,8 +183,6 @@ namespace ceph {
186183
return {};
187184
}
188185

189-
static constexpr bool mutex_debugging = false;
190-
191186
// debug methods. Note that these can blindly return true
192187
// because any code that does anything other than assert these
193188
// are true is broken.

src/common/config_proxy.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class ConfigProxy {
3131
using rev_obs_map_t = ObsMgr::rev_obs_map;
3232

3333
void _call_observers(rev_obs_map_t& rev_obs) {
34-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
3534
for (auto& [obs, keys] : rev_obs) {
3635
(*obs)->handle_conf_change(*this, keys);
3736
}

src/osdc/Journaler.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -529,76 +529,62 @@ class Journaler {
529529
// ===================
530530

531531
Header get_last_committed() const {
532-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
533532
lock_guard l(lock);
534533
return last_committed;
535534
}
536535
Header get_last_written() const {
537-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
538536
lock_guard l(lock);
539537
return last_written;
540538
}
541539

542540
uint64_t get_layout_period() const {
543-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
544541
lock_guard l(lock);
545542
return layout.get_period();
546543
}
547544
file_layout_t get_layout() const {
548-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
549545
lock_guard l(lock);
550546
return layout;
551547
}
552548
bool is_active() const {
553-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
554549
lock_guard l(lock);
555550
return state == STATE_ACTIVE;
556551
}
557552
bool is_stopping() const {
558-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
559553
lock_guard l(lock);
560554
return state == STATE_STOPPING;
561555
}
562556
int get_error() const {
563-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
564557
lock_guard l(lock);
565558
return error;
566559
}
567560
bool is_readonly() const {
568-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
569561
lock_guard l(lock);
570562
return readonly;
571563
}
572564
bool is_readable();
573565
bool _is_readable();
574566
bool try_read_entry(bufferlist& bl);
575567
uint64_t get_write_pos() const {
576-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
577568
lock_guard l(lock);
578569
return write_pos;
579570
}
580571
uint64_t get_write_safe_pos() const {
581-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
582572
lock_guard l(lock);
583573
return safe_pos;
584574
}
585575
uint64_t get_read_pos() const {
586-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
587576
lock_guard l(lock);
588577
return read_pos;
589578
}
590579
uint64_t get_expire_pos() const {
591-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
592580
lock_guard l(lock);
593581
return expire_pos;
594582
}
595583
uint64_t get_trimmed_pos() const {
596-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
597584
lock_guard l(lock);
598585
return trimmed_pos;
599586
}
600587
size_t get_journal_envelope_size() const {
601-
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
602588
lock_guard l(lock);
603589
return journal_stream.get_envelope_size();
604590
}

0 commit comments

Comments
 (0)