-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilesystem.h
54 lines (42 loc) · 1.07 KB
/
filesystem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef FILESYSTEM_H_INCLUDED
#define FILESYSTEM_H_INCLUDED
#include <time.h>
#define FS_DEF_NAME "filesys.fs"
#define FS_INODE_SIZE 128
#define FS_INODES 160
#define BLOCK_SIZE 4096
typedef struct fsys_SuperBlock{
int blockSize;
int iNodeSize;
int iNodesCount;
int iNodesBlockNum;
int iNodesOffset;
int dataBlockNum;
int dataBlockOffset;
int iNodeBitmapOffset;
int dataBitmapOffset;
} fsys_SuperBlock;
typedef struct fsys_iNodeBitmap{
char bitmap[FS_INODES];
} fsys_iNodesBitmap;
typedef struct fsys_dataBitmap{
char bitmap[50000];
} fsys_dataBitmap;
typedef struct fsys_iNode{
int startBlock;
char accRights;
int size;
time_t lastAcc;
char name[96];
} fsys_iNode;
//errors
#define FILE_ALREADY_EXISTS -1
#define NO_INODES -2
#define FSYS_ALREADY_CREATED -3
#define NO_SUCH_FSYS -4
#define COULDNT_CREATE_FSYS -5
#define MISSING_ARGS -6
#define INCORRECT_ARG -7
#define FILE_NOT_EXISTING -8
#define FILE_NOT_IN_FSYS -9
#endif // FILESYSTEM_H_INCLUDED