-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvsfs.h
30 lines (27 loc) · 767 Bytes
/
vsfs.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
#define FILE_BLOCKS 5
#define MAX_NAMESIZE 28
#define BLOCK_SIZE 256
#define MAX_FILES_OPENED 256
struct fstat {
int ftype;
int nlinks;
int size;
int blocks_map[FILE_BLOCKS];
};
struct dir_rec {
int id;
char name[MAX_NAMESIZE];
};
int vs_mkfs(char *filename, int dev_size);
int vs_mount(char *filename);
int vs_umount();
int vs_getstat(int id, struct fstat *stat);
int vs_readdir(struct dir_rec *dir_rec, int next);
int vs_create(char *pathname);
int vs_open(char *pathname);
int vs_close(int fd);
int vs_read(int fd, int offset, int size, char *buffer);
int vs_write(int fd, int offset, int size, char *buffer);
int vs_link(char *src_pathname, char *dest_pathname);
int vs_unlink(char *pathname);
int vs_truncate(char *pathname, int size);