]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PaxosService: inline trim()
authorSage Weil <sage@inktank.com>
Tue, 9 Jul 2013 05:04:10 +0000 (22:04 -0700)
committerSage Weil <sage@inktank.com>
Tue, 9 Jul 2013 18:09:46 +0000 (11:09 -0700)
This is now trivial; pull it into the caller.

Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/PaxosService.cc
src/mon/PaxosService.h

index 959bdf2d3c4e819a80a3c2620a91b3cc5f7c27f7..42452e9cfa8d33e507dc06b764323a0e08c5912f 100644 (file)
@@ -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)
 {
index dc63e4e46b9c9a74c802bc445cf99627171aff0c..6e1b136cde0ff63eb571ac85e91b0bbdeb1560d3 100644 (file)
@@ -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