[block manager] The dirty flag for blocks was never being cleared, causes redundant writes.

This commit is contained in:
Joe Thornber 2013-04-26 13:18:24 +01:00
parent a55f6fcf78
commit 0b4c359a63

View File

@ -231,6 +231,7 @@ block_manager<BlockSize>::block::flush()
if (dirty_) {
validator_->prepare(*data_, location_);
io_->write_buffer(location_, *data_);
dirty_ = false;
}
}
@ -341,6 +342,9 @@ block_manager<BlockSize>::read_lock(block_address location,
if (cached_block) {
(*cached_block)->check_read_lockable();
// FIXME: a different validator may now be set.
return read_ref(*this, *cached_block);
}