From: Sage Weil Date: Tue, 9 Jul 2013 05:04:10 +0000 (-0700) Subject: mon/PaxosService: inline trim() X-Git-Tag: v0.67-rc1~134^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=44db2ac548752f007b0a8fc9451e01c176667e13;p=ceph.git mon/PaxosService: inline trim() This is now trivial; pull it into the caller. Signed-off-by: Sage Weil --- diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index 959bdf2d3c4..42452e9cfa8 100644 --- a/src/mon/PaxosService.cc +++ b/src/mon/PaxosService.cc @@ -349,23 +349,17 @@ void PaxosService::maybe_trim() dout(10) << __func__ << " trimming to " << trim_to << ", " << to_remove << " states" << dendl; MonitorDBStore::Transaction t; - encode_trim(&t, trim_to); + trim(&t, get_first_committed(), trim_to); + put_first_committed(&t, trim_to); + + // let the service add any extra stuff + encode_trim_extra(&t, trim_to); + bufferlist bl; t.encode(bl); - paxos->propose_new_value(bl, new C_Committed(this)); } -void PaxosService::encode_trim(MonitorDBStore::Transaction *t, version_t trim_to) -{ - dout(10) << __func__ << " to " << trim_to << dendl; - trim(t, get_first_committed(), trim_to); - put_first_committed(t, trim_to); - - // let the service add any extra stuff - encode_trim_extra(t, trim_to); -} - void PaxosService::trim(MonitorDBStore::Transaction *t, version_t from, version_t to) { diff --git a/src/mon/PaxosService.h b/src/mon/PaxosService.h index dc63e4e46b9..6e1b136cde0 100644 --- a/src/mon/PaxosService.h +++ b/src/mon/PaxosService.h @@ -658,16 +658,6 @@ public: * @param to the upper limit of the interval to be trimmed (not including) */ void trim(MonitorDBStore::Transaction *t, version_t from, version_t to); - /** - * Trim our log - * - * Will call encode_trim_extra(), allowing services to add - * additional bits to the trim transaction. - * - * @param txn the transaction to encode to - * @param first The version that should become the first one in the log. - */ - void encode_trim(MonitorDBStore::Transaction *t, version_t first); /** * encode service-specific extra bits into trim transaction