aboutsummaryrefslogtreecommitdiffstats
path: root/src/filesys/filesys.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/filesys/filesys.h')
-rw-r--r--src/filesys/filesys.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/filesys/filesys.h b/src/filesys/filesys.h
new file mode 100644
index 0000000..71efb16
--- /dev/null
+++ b/src/filesys/filesys.h
@@ -0,0 +1,23 @@
+#ifndef FILESYS_FILESYS_H
+#define FILESYS_FILESYS_H
+
+#include <stdbool.h>
+#include "filesys/off_t.h"
+
+/* Sectors of system file inodes. */
+#define FREE_MAP_SECTOR 0 /* Free map file inode sector. */
+#define ROOT_DIR_SECTOR 1 /* Root directory file inode sector. */
+
+/* Disk used for file system. */
+extern struct disk *filesys_disk;
+
+void filesys_init (bool format);
+void filesys_done (void);
+
+bool filesys_create (const char *name, off_t initial_size);
+bool filesys_remove (const char *name);
+
+struct file *filesys_open (const char *name);
+void filesys_close (struct file *file);
+
+#endif /* filesys/filesys.h */