Setup FS structure and set fs to point to struct
This commit is contained in:
+32
-1
@@ -1,6 +1,9 @@
|
||||
#ifndef FUSE_H
|
||||
#define FUSE_H
|
||||
|
||||
#define DEFAULTINODEMAX 128
|
||||
#define DEFAULTBLOCKSIZE 512 // Size in bytes
|
||||
|
||||
typedef struct fuseArgStruct
|
||||
{
|
||||
int create;
|
||||
@@ -17,12 +20,40 @@ typedef struct fuseArgStruct
|
||||
int filefsname;
|
||||
} fuseArgStruct;
|
||||
|
||||
typedef struct BlockStruct
|
||||
{
|
||||
char byte[DEFAULTBLOCKSIZE];
|
||||
} BlockStruct;
|
||||
|
||||
typedef struct InodeStruct
|
||||
{
|
||||
BlockStruct* dataBlock;
|
||||
} InodeStruct;
|
||||
|
||||
typedef struct SuperBlockStruct
|
||||
{
|
||||
int blockCount;
|
||||
int blockSize;
|
||||
} SuperBlockStruct;
|
||||
|
||||
typedef struct FBLStruct
|
||||
{
|
||||
int freeList[DEFAULTINODEMAX/32];
|
||||
} FBLStruct;
|
||||
|
||||
typedef struct FileSystemStruct
|
||||
{
|
||||
SuperBlockStruct superBlock;
|
||||
FBLStruct freeList;
|
||||
InodeStruct inodes[DEFAULTINODEMAX];
|
||||
} FileSystemStruct;
|
||||
|
||||
void Fuse(int argc, char* argv[]);
|
||||
void FuseGetArgs(int argc, char* argv[], fuseArgStruct* fuseArgs);
|
||||
void FuseCheckArgs(int argc, char* argv[], fuseArgStruct* fuseArgs);
|
||||
void FuseGivenTest(fuseArgStruct* fuseArgs, char* programPath);
|
||||
void FuseStructInit(fuseArgStruct* fuseStruct);
|
||||
void FuseUsageError(char* programPath);
|
||||
int zerosize(int fd);
|
||||
int FindEmptyBitPosition(int number);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#ifndef FUSEACTIONS_H
|
||||
#define FUSEACTIONS_H
|
||||
|
||||
#include "fuse.h"
|
||||
|
||||
#define FSSIZE 10000000
|
||||
|
||||
extern unsigned char* fs;
|
||||
|
||||
void MapFS(int fd);
|
||||
void UnmapFS();
|
||||
void MapFS(FileSystemStruct* fs, int fd);
|
||||
void UnmapFS(FileSystemStruct* fs);
|
||||
void FormatFS();
|
||||
void LoadFS();
|
||||
void ListFS();
|
||||
|
||||
Reference in New Issue
Block a user