aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/include/nullfs.h
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-09 19:24:42 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-09 19:24:42 +0100
commit440d9dc470703d20a55365b3a560196e71d450d4 (patch)
treebcc864c7aeb0af7a81c4fcd7430fa8c3001f8383 /src/kernel/include/nullfs.h
parentcaf842864bdc0794e387f9580af96ab1036996f4 (diff)
downloadkogata-440d9dc470703d20a55365b3a560196e71d450d4.tar.gz
kogata-440d9dc470703d20a55365b3a560196e71d450d4.zip
Start work on filesystems.
Diffstat (limited to 'src/kernel/include/nullfs.h')
-rw-r--r--src/kernel/include/nullfs.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/kernel/include/nullfs.h b/src/kernel/include/nullfs.h
new file mode 100644
index 0000000..16fff87
--- /dev/null
+++ b/src/kernel/include/nullfs.h
@@ -0,0 +1,25 @@
+#pragma once
+
+#include <vfs.h>
+
+#define NULLFS_OPT_CREATE_EN 1
+#define NULLFS_OPT_DELETE_EN 2
+
+typedef struct nullfs nullfs_t;
+
+typedef struct {
+ void* (*open)(void* f, int mode, fs_handle_t *h);
+ size_t (*read)(void* f, size_t offset, size_t len, char* buf);
+ size_t (*write)(void* f, size_t offset, size_t len, const char* buf);
+ void (*close)(void* f);
+ void (*delete)(void* f);
+} nullfs_node_ops_t;
+
+void register_nullfs_driver();
+
+nullfs_t* as_nullfs(fs_t *fs);
+
+bool nullfs_add(nullfs_t *f, const char* name, void* data, nullfs_node_ops_t* ops);
+bool nullfs_add_ram_file(nullfs_t *f, const char* name, void* data, size_t init_sz, int ok_modes);
+
+/* vim: set ts=4 sw=4 tw=0 noet :*/