}
LogChannel::LogChannel(CephContext *cct, LogClient *lc, const string &channel)
- : cct(cct), parent(lc), channel_lock("LogChannel::channel_lock"),
+ : cct(cct), parent(lc),
log_channel(channel), log_to_syslog(false), log_to_monitors(false)
{
}
LogChannel::LogChannel(CephContext *cct, LogClient *lc,
const string &channel, const string &facility,
const string &prio)
- : cct(cct), parent(lc), channel_lock("LogChannel::channel_lock"),
+ : cct(cct), parent(lc),
log_channel(channel), log_prio(prio), syslog_facility(facility),
log_to_syslog(false), log_to_monitors(false)
{
LogClient::LogClient(CephContext *cct, Messenger *m, MonMap *mm,
enum logclient_flag_t flags)
: cct(cct), messenger(m), monmap(mm), is_mon(flags & FLAG_MON),
- log_lock("LogClient::log_lock"), last_log_sent(0), last_log(0)
+ last_log_sent(0), last_log(0)
{
}
void LogChannel::do_log(clog_type prio, const std::string& s)
{
- std::lock_guard<Mutex> l(channel_lock);
+ std::lock_guard l(channel_lock);
if (CLOG_ERROR == prio) {
ldout(cct,-1) << "log " << prio << " : " << s << dendl;
} else {
Message *LogClient::get_mon_log_message(bool flush)
{
- std::lock_guard<Mutex> l(log_lock);
+ std::lock_guard l(log_lock);
if (flush) {
if (log_queue.empty())
return nullptr;
bool LogClient::are_pending()
{
- std::lock_guard<Mutex> l(log_lock);
+ std::lock_guard l(log_lock);
return last_log > last_log_sent;
}
Message *LogClient::_get_mon_log_message()
{
- ceph_assert(log_lock.is_locked());
+ ceph_assert(ceph_mutex_is_locked(log_lock));
if (log_queue.empty())
return NULL;
void LogClient::_send_to_mon()
{
- ceph_assert(log_lock.is_locked());
+ ceph_assert(ceph_mutex_is_locked(log_lock));
ceph_assert(is_mon);
ceph_assert(messenger->get_myname().is_mon());
ldout(cct,10) << __func__ << " log to self" << dendl;
version_t LogClient::queue(LogEntry &entry)
{
- std::lock_guard<Mutex> l(log_lock);
+ std::lock_guard l(log_lock);
entry.seq = ++last_log;
log_queue.push_back(entry);
uint64_t LogClient::get_next_seq()
{
- std::lock_guard<Mutex> l(log_lock);
+ std::lock_guard l(log_lock);
return ++last_log;
}
bool LogClient::handle_log_ack(MLogAck *m)
{
- std::lock_guard<Mutex> l(log_lock);
+ std::lock_guard l(log_lock);
ldout(cct,10) << "handle_log_ack " << *m << dendl;
version_t last = m->last;