Caller decides whether to release the message's reference. It may want
to use the same message on another LogClient, if we decide not to handle
it.
Currently we always handle the message and thus always return true. This
will not be as such later in the patch series.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
return log;
}
-void LogClient::handle_log_ack(MLogAck *m)
+bool LogClient::handle_log_ack(MLogAck *m)
{
Mutex::Locker l(log_lock);
ldout(cct,10) << "handle_log_ack " << *m << dendl;
ldout(cct,10) << " logged " << entry << dendl;
q = log_queue.erase(q);
}
- m->put();
+ return true;
}
LogClient(CephContext *cct, Messenger *m, MonMap *mm,
enum logclient_flag_t flags);
- void handle_log_ack(MLogAck *m);
+ bool handle_log_ack(MLogAck *m);
LogClientTemp debug() {
return LogClientTemp(CLOG_DEBUG, *this);
case MSG_LOGACK:
if (log_client) {
log_client->handle_log_ack(static_cast<MLogAck*>(m));
+ m->put();
if (more_log_pending) {
send_log();
}
case MSG_LOGACK:
clog.handle_log_ack((MLogAck*)m);
+ m->put();
break;
// monmap