-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkrffs_file_system.h
More file actions
44 lines (35 loc) · 1022 Bytes
/
krffs_file_system.h
File metadata and controls
44 lines (35 loc) · 1022 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
40
41
42
43
44
#ifndef KRFFS_FILE_SYSTEM_H
#define KRFFS_FILE_SYSTEM_H
#include <stdint.h>
#include <sys/types.h>
struct krffs_node;
/*
The magic value at the beginning of each metadata node. Magic values can be
used to identify and check file system consistency.
Should be equal to ASCII codes of characters K and R.
*/
static const uint16_t KRFFS_File_System_Magic = 0x4B52;
/*
The file system's root node name.
*/
static const char KRFFS_File_System_Root_Node_Name[] = "";
/*
The file system's root node mode.
*/
static const uint16_t KRFFS_File_System_Root_Node_Mode = 0755;
/*
General file system data. Nodes point to memory pages mapped to a file.
*/
struct krffs_file_system
{
struct krffs_node *node;
off_t size;
};
/*
Initializes the file system by creating a root metadata node and a free
space node after it.
*/
struct krffs_file_system *krffs_initialize_file_system(
struct krffs_file_system *file_system
);
#endif