]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PaxosService: unwind service_should_trim() helper
authorSage Weil <sage@inktank.com>
Tue, 9 Jul 2013 04:41:55 +0000 (21:41 -0700)
committerSage Weil <sage@inktank.com>
Tue, 9 Jul 2013 04:41:55 +0000 (21:41 -0700)
Nobody overloads it; put it inline in should_trim().

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

index 7be5f9f6b1c3c4236ce364506ec9ffb1363bb2b7..5c06f193271b67ab5384f6d5138c3c41579cc588 100644 (file)
@@ -337,7 +337,8 @@ void PaxosService::maybe_trim()
 
 bool PaxosService::should_trim()
 {
-  if (!service_should_trim())
+  update_trim();
+  if (get_trim_to() == 0)
     return false;
 
   if (g_conf->paxos_service_trim_min > 0) {
index 3d9d8acd00fe7a0225c6fe73897a91e35b552802..cd00718a36711d351950a195b174362f0852d055 100644 (file)
@@ -691,19 +691,6 @@ public:
    */
   bool should_trim();
 
-  /**
-   * Check if we should trim.
-   *
-   * We define this function here, because we assume that as long as we know of
-   * a version to trim, we should trim. However, any implementation should feel
-   * free to define its own version of this function if deemed necessary.
-   *
-   * @returns true if we should trim; false otherwise.
-   */
-  virtual bool service_should_trim() {
-    update_trim();
-    return (get_trim_to() > 0);
-  }
   /**
    * Update our trim status. We do nothing here, because there is no
    * straightforward way to update the trim version, since that's service