From ae2396ec07c83b8f0d01618cdcc98ceec85ef0df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Piotr=20Da=C5=82ek?= Date: Thu, 16 Jul 2015 11:10:37 +0200 Subject: [PATCH] buffer.cc: postpone crc cache invalidation in bufferlist::rebuild() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Postpone CRC cache invalidation. Do it only once after all data have been moved. Signed-off-by: Piotr Dałek --- src/common/buffer.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index dba06ee05d1e..7e34a03c29ce 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -1349,12 +1349,13 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER; for (std::list::iterator it = _buffers.begin(); it != _buffers.end(); ++it) { - nb.copy_in(pos, it->length(), it->c_str()); + nb.copy_in(pos, it->length(), it->c_str(), false); pos += it->length(); } _memcopy_count += pos; _buffers.clear(); _buffers.push_back(nb); + invalidate_crc(); } void buffer::list::rebuild_aligned(unsigned align) -- 2.47.3