-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfs.h
More file actions
71 lines (48 loc) · 1.24 KB
/
fs.h
File metadata and controls
71 lines (48 loc) · 1.24 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
#include <fuse.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#ifndef SSSFS
#define SSSFS
#define MAX_BLOCKS 128
#define MAX_DIRECT_POINTERS 10
struct dir_ent
{
char d_name[256];
ino_t d_ino;
off_t d_off;
unsigned short d_recordlen;
unsigned char d_type;
};
typedef struct dir_ent dir_ent;
typedef struct file{
char data[256];
long int offset;
dir_ent children[MAX_DIRECT_POINTERS];
}file;
typedef struct inode{
char * path;
char * name;
char * type;
mode_t permissions;
uid_t user_id;
gid_t group_id;
int num_children;
time_t a_time;
time_t m_time;
time_t c_time;
time_t b_time;
off_t size;
int blk_no[MAX_DIRECT_POINTERS];
unsigned long int inode_number;
}inode;
int i_bitmap[MAX_BLOCKS];
int d_bitmap[MAX_BLOCKS];
inode inode_blocks[MAX_BLOCKS];
file file_blocks[MAX_BLOCKS];
#endif