From 6a025ef3afd5a3d3ada562dc4f97237a5195ce2b Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 11 Dec 2014 11:21:47 -0800 Subject: [PATCH] PGLog: trim mod_desc after appending to the log We'll want he callers up the chain to take the log entry as a const ref. Signed-off-by: Samuel Just --- src/osd/PG.cc | 6 ------ src/osd/PGLog.h | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 4c05a8400fae7..e0163609ac771 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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; diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index 1961ec5fc8d25..ac2f4b3563ced 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -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; -- 2.39.5