getting inode number using freeList is breaking program, will fix later

This commit is contained in:
2022-11-25 23:51:27 -06:00
parent 81647a3100
commit 1c237c1bcc
5 changed files with 75 additions and 43 deletions
+16 -14
View File
@@ -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
+2
View File
@@ -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);