profuse/Cache/MappedBlockCache.h
ksherlock ef4f906d70 more block checking
git-svn-id: https://profuse.googlecode.com/svn/branches/v2@259 aa027e90-d47c-11dd-86d7-074df07e0730
2010-05-22 16:11:41 +00:00

36 lines
659 B
C++

#ifndef __MAPPED_BLOCK_CACHE_H__
#define __MAPPED_BLOCK_CACHE_H__
#include <Cache/BlockCache.h>
namespace Device {
class MappedBlockCache : public BlockCache {
public:
MappedBlockCache(BlockDevice *, void *data);
virtual ~MappedBlockCache();
virtual void sync();
virtual void write(unsigned block, const void *vp);
virtual void zeroBlock(unsigned block);
virtual void *acquire(unsigned block);
virtual void release(unsigned block, int flags);
virtual void markDirty(unsigned block);
private:
void sync(unsigned block);
uint8_t *_data;
bool _dirty;
};
} // namespace
#endif