-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructure.h
More file actions
39 lines (32 loc) · 703 Bytes
/
structure.h
File metadata and controls
39 lines (32 loc) · 703 Bytes
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
#ifndef STRUCTURE_H
#define STRUCTURE_H
#define MAGIC 0x1304ABCD
#define FS_BLOCK_SIZE 512 //bytes
#define INODE_SIZE 128 //bytes
#define BLOCK_COUNT ((INODE_SIZE - (48+4*4)) / 4)
typedef unsigned int uint_t;
typedef unsigned char uchar_t;
typedef struct superblock
{
uint_t magic;
uint_t part_size;
uint_t blk_size;
uint_t inode_size;
uint_t inode_table_size;
uint_t inode_tbl_blk_start;
uint_t inode_count;
uint_t data_blk_start;
uint_t reserved[FS_BLOCK_SIZE/4 -8];
}super_t;
typedef struct inode
{
char name[16];
char parent_dir[16];
char dir[16];
uint_t type;
uint_t size;
uint_t timestamp;
uint_t permissions;
uint_t blocks[BLOCK_COUNT];
}inode_t;
#endif