#ifndef FUSE_H #define FUSE_H #include #define DEFAULTINODEMAX 128 #define DEFAULTBLOCKSIZE 512 // Size in bytes typedef struct fuseArgStruct { int create; int list; int add; int remove; int extract; char* toAdd; char* toRemove; char* toExtract; char* fsname; int fd; int newfs; 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]; } BlockStruct; // TODO: Adjust Inodes to be 128 inodes with 128 direct block references *each* // Slides exist for inode structure typedef struct InodeStruct { char filePath[256]; off_t fileSize; BlockStruct dataBlock; } InodeStruct; typedef struct FileSystemStruct { SuperBlockStruct superBlock; FBLStruct fbl; InodeStruct inodes[DEFAULTINODEMAX]; } FileSystemStruct; void Fuse(int argc, char* argv[]); void GetArguments(int argc, char* argv[], fuseArgStruct* fuseArgs); void OpenFS(fuseArgStruct* fuseArgs, char* programPath); FileSystemStruct* SetupFS(fuseArgStruct* fuseArgs); void RunFuse(FileSystemStruct* fs, fuseArgStruct* fuseArgs); void TearDownFS(void); 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