mirror of
https://github.com/ksherlock/profuse.git
synced 2024-12-22 20:29:59 +00:00
ef4f906d70
git-svn-id: https://profuse.googlecode.com/svn/branches/v2@259 aa027e90-d47c-11dd-86d7-074df07e0730
36 lines
659 B
C++
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
|
|
|