getting inode number using freeList is breaking program, will fix later
This commit is contained in:
+16
-14
@@ -22,6 +22,17 @@ typedef struct fuseArgStruct
|
||||
int filefsname;
|
||||
} fuseArgStruct;
|
||||
|
||||
typedef struct SuperBlockStruct
|
||||
{
|
||||
blksize_t blockSize;
|
||||
blkcnt_t blockCount;
|
||||
} SuperBlockStruct;
|
||||
|
||||
typedef struct FBLStruct
|
||||
{
|
||||
int freeList[DEFAULTINODEMAX/32];
|
||||
} FBLStruct;
|
||||
|
||||
typedef struct BlockStruct
|
||||
{
|
||||
char byte[DEFAULTBLOCKSIZE];
|
||||
@@ -34,22 +45,11 @@ typedef struct InodeStruct
|
||||
BlockStruct dataBlock;
|
||||
} InodeStruct;
|
||||
|
||||
typedef struct SuperBlockStruct
|
||||
{
|
||||
blksize_t blockSize;
|
||||
blkcnt_t blockCount;
|
||||
} SuperBlockStruct;
|
||||
|
||||
typedef struct FBLStruct
|
||||
{
|
||||
int freeList[DEFAULTINODEMAX/32];
|
||||
} FBLStruct;
|
||||
|
||||
typedef struct FileSystemStruct
|
||||
{
|
||||
SuperBlockStruct superBlock;
|
||||
FBLStruct fbl;
|
||||
InodeStruct inodes[DEFAULTINODEMAX];
|
||||
SuperBlockStruct* superBlock;
|
||||
FBLStruct* fbl;
|
||||
InodeStruct* inodes;
|
||||
} FileSystemStruct;
|
||||
|
||||
void Fuse(int argc, char* argv[]);
|
||||
@@ -59,5 +59,7 @@ void FuseStructInit(fuseArgStruct* fuseStruct);
|
||||
void FuseUsageError(char* programPath);
|
||||
int zerosize(int fd);
|
||||
int FindEmptyBitPosition(int number);
|
||||
ino_t GetFreeInodeNumber(int* fbl);
|
||||
void SetFileSystemDefaults(FileSystemStruct* fs);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
#define FSSIZE 10000000
|
||||
|
||||
extern unsigned char* tempfs;
|
||||
|
||||
void MapFS(FileSystemStruct* fs, int fd);
|
||||
void UnmapFS(FileSystemStruct* fs);
|
||||
void FormatFS(FileSystemStruct* fs);
|
||||
|
||||
Reference in New Issue
Block a user