[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tyndur-devel] [PATCH 08/11] kernel2: dev:/-Dateisystem
+ kernel2: Ein zusätzliches temporäres Dateisystem dev:/ wird angelegt.
Es enthält ein Unterverzeichnis fs/, in dem Symlinks auf existierende
Dateisysteme abgelegt werden sollen.
Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
src/kernel2/src/lostio/modules/tmp.c | 35 +++++++++++++++++++++++++----------
1 file changed, 25 insertions(+), 10 deletions(-)
diff --git a/src/kernel2/src/lostio/modules/tmp.c b/src/kernel2/src/lostio/modules/tmp.c
index 1f630e7..f7a7c84 100644
--- a/src/kernel2/src/lostio/modules/tmp.c
+++ b/src/kernel2/src/lostio/modules/tmp.c
@@ -202,22 +202,37 @@ static int unlink(struct lio_resource* parent, const char* name)
return 0;
}
+#define TMP_LIO_OPS \
+ { \
+ .load_root = load_root, \
+ .load_children = load_children, \
+ .read = tmp_read, \
+ .write = tmp_write, \
+ .make_file = make_file, \
+ .make_dir = make_dir, \
+ .make_symlink = make_symlink, \
+ .unlink = unlink, \
+ }
static struct lio_service service = {
.name = "tmp",
- .lio_ops = {
- .load_root = load_root,
- .load_children = load_children,
- .read = tmp_read,
- .write = tmp_write,
- .make_file = make_file,
- .make_dir = make_dir,
- .make_symlink = make_symlink,
- .unlink = unlink,
- },
+ .lio_ops = TMP_LIO_OPS,
+};
+
+static struct lio_service dev_service = {
+ .name = "dev",
+ .lio_ops = TMP_LIO_OPS,
};
void lio_init_tmp(void)
{
+ struct lio_resource* dev_root;
+
lio_add_service(&service);
+
+ lio_add_service(&dev_service);
+ dev_root = lio_get_resource("dev:/", false);
+ if (dev_root != NULL) {
+ lio_mkdir(dev_root, "fs");
+ }
}
--
2.1.4