mirror of
https://github.com/ksherlock/profuse.git
synced 2026-03-15 07:16:47 +00:00
block cache support.
git-svn-id: https://profuse.googlecode.com/svn/branches/v2@220 aa027e90-d47c-11dd-86d7-074df07e0730
This commit is contained in:
@@ -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());
|
||||
}
|
||||
Reference in New Issue
Block a user