35 lines
690 B
C++
35 lines
690 B
C++
// Ext2BlockCache.h
|
|
// Author: Josh Holtrop
|
|
// Date: 12/29/05
|
|
// Modified: 12/29/05
|
|
|
|
#ifndef __HOS_EXT2BLOCKCACHE_H__
|
|
#define __HOS_EXT2BLOCKCACHE_H__ __HOS_EXT2BLOCKCACHE_H__
|
|
|
|
#include "fs/vfs.h"
|
|
#include "ext2.h"
|
|
|
|
class Ext2BlockCache
|
|
{
|
|
protected:
|
|
Ext2fs *myFS;
|
|
u32_t myInum;
|
|
ext2_inode_t *myInode;
|
|
u32_t myBlockSize;
|
|
u8_t *myCache[3];
|
|
u8_t myCacheAddress[3];
|
|
u8_t myCacheDirty[3];
|
|
u32_t myInodeDirty;
|
|
|
|
void setCache(u32_t level, u32_t fsblock);
|
|
u32_t getFSBlock(u32_t block, int create);
|
|
|
|
public:
|
|
Ext2BlockCache(Ext2fs *fs, u32_t inum, ext2_inode_t *inode);
|
|
~Ext2BlockCache();
|
|
int readBlock(u32_t blockNum, void *buf);
|
|
int writeBlock(u32_t blockNum, void *buf);
|
|
};
|
|
|
|
#endif
|