]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PGLog: trim mod_desc after appending to the log
authorSamuel Just <sjust@redhat.com>
Thu, 11 Dec 2014 19:21:47 +0000 (11:21 -0800)
committerSamuel Just <sjust@redhat.com>
Thu, 22 Jan 2015 21:11:50 +0000 (13:11 -0800)
We'll want he callers up the chain to take the log
entry as a const ref.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/PG.cc
src/osd/PGLog.h

index 4c05a8400fae7fcdbc072891caa5e4cd6e0d6831..e0163609ac7717546456d98d4576bd5de347daec 100644 (file)
@@ -2858,12 +2858,6 @@ void PG::add_log_entry(pg_log_entry_t& e, bufferlist& log_bl)
   if (e.user_version > info.last_user_version)
     info.last_user_version = e.user_version;
 
-  /**
-   * Make sure we don't keep around more than we need to in the
-   * in-memory log
-   */
-  e.mod_desc.trim_bl();
-
   // log mutation
   pg_log.add(e);
   dout(10) << "add_log_entry " << e << dendl;
index 1961ec5fc8d252b061e4c0985056674e13ac97cd..ac2f4b3563ced6ec4790c68d3eb63484c875d0ba 100644 (file)
@@ -179,6 +179,12 @@ struct PGLog {
       // add to log
       log.push_back(e);
 
+      /**
+       * Make sure we don't keep around more than we need to in the
+       * in-memory log
+       */
+      log.back().mod_desc.trim_bl();
+
       // riter previously pointed to the previous entry
       if (rollback_info_trimmed_to_riter == log.rbegin())
        ++rollback_info_trimmed_to_riter;