From: Piotr Dałek Date: Thu, 16 Jul 2015 09:10:37 +0000 (+0200) Subject: buffer.cc: postpone crc cache invalidation in bufferlist::rebuild() X-Git-Tag: v9.1.0~333^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae2396ec07c83b8f0d01618cdcc98ceec85ef0df;p=ceph.git buffer.cc: postpone crc cache invalidation in bufferlist::rebuild() Postpone CRC cache invalidation. Do it only once after all data have been moved. Signed-off-by: Piotr Dałek --- 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)