block cache support.

git-svn-id: https://profuse.googlecode.com/svn/branches/v2@220 aa027e90-d47c-11dd-86d7-074df07e0730
This commit is contained in:
ksherlock
2010-05-18 19:59:18 +00:00
parent be7a7bafc1
commit 629efe6da5
11 changed files with 92 additions and 14 deletions

View File

@@ -9,6 +9,9 @@
#include <Endian/Endian.h>
#include <Endian/IOBuffer.h>
#include <Cache/MappedBlockCache.h>
using namespace Device;
using namespace BigEndian;
@@ -17,6 +20,7 @@ using ProFUSE::Exception;
using ProFUSE::POSIXException;
enum {
oDataSize = 64,
oDataChecksum = 72,
@@ -219,4 +223,14 @@ void DiskCopy42Image::write(unsigned block, const void *bp)
{
DiskImage::write(block, bp);
_changed = true;
}
BlockCache *DiskCopy42Image::createBlockCache(unsigned size)
{
// if not readonly, mark changed so crc will be updated at close.
if (!readOnly()) _changed = true;
return new MappedBlockCache(this, address());
}