-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINode.h
59 lines (38 loc) · 934 Bytes
/
INode.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
55
56
57
58
59
/*
* This is the inode structure
*/
#pragma once
#include "Globals.h"
#include "time.h"
#include "string.h"
#include "sys/types.h"
enum FILE_TYPE {
FREE = -1,
INIT = 1,
REGULAR = 2,
DIRECTORY = 3,
FIFO = 4,
CHAR = 5,
BLOCK = 6
};
typedef struct INode {
//disk fields
enum FILE_TYPE _in_type;
char _in_owner[INODE_OWNER_NAME_LEN];
//uncomment these will induce crash
uid_t _in_uid;
gid_t _in_gid;
UINT _in_permissions;
LONG _in_modtime;
LONG _in_accesstime;
LONG _in_changetime;
LONG _in_filesize;
UINT _in_linkcount;
LONG _in_directBlocks[INODE_NUM_DIRECT_BLKS];
LONG _in_sIndirectBlocks[INODE_NUM_S_INDIRECT_BLKS];
LONG _in_dIndirectBlocks[INODE_NUM_D_INDIRECT_BLKS];
LONG _in_tIndirectBlocks[INODE_NUM_T_INDIRECT_BLKS];
} INode;
UINT initializeINode(INode*, UINT);
// prints an inode out for debugging
void printINode(INode*);