Multiuser, Capabilities and Access Controls (#54)
[lunaix-os.git] / lunaix-os / kernel / fs / fs_export.c
index 046204f026e556b5e4736433710df8362bc29e83..452bcdf724516eab54590b9ee8063c869121c85a 100644 (file)
@@ -4,8 +4,8 @@
 
 extern struct llist_header all_mnts;
 
 
 extern struct llist_header all_mnts;
 
-void
-__mount_read(struct twimap* map)
+static void
+__twimap_read_mounts(struct twimap* map)
 {
     char path[512];
     struct v_mount* mnt = twimap_index(map, struct v_mount*);
 {
     char path[512];
     struct v_mount* mnt = twimap_index(map, struct v_mount*);
@@ -20,8 +20,8 @@ __mount_read(struct twimap* map)
     twimap_printf(map, "\n");
 }
 
     twimap_printf(map, "\n");
 }
 
-int
-__mount_next(struct twimap* map)
+static int
+__twimap_gonext_mounts(struct twimap* map)
 {
     struct v_mount* mnt = twimap_index(map, struct v_mount*);
     if (mnt->list.next == &all_mnts) {
 {
     struct v_mount* mnt = twimap_index(map, struct v_mount*);
     if (mnt->list.next == &all_mnts) {
@@ -31,32 +31,25 @@ __mount_next(struct twimap* map)
     return 1;
 }
 
     return 1;
 }
 
-void
-__mount_reset(struct twimap* map)
+static void
+__twimap_reset_mounts(struct twimap* map)
 {
     map->index = container_of(all_mnts.next, struct v_mount, list);
 }
 
 void
 {
     map->index = container_of(all_mnts.next, struct v_mount, list);
 }
 
 void
-__version_rd(struct twimap* map)
+__twimap_read_version(struct twimap* map)
 {
     twimap_printf(map,
 {
     twimap_printf(map,
-                  "LunaixOS version %s (%s-gnu-gcc %s) %s %s",
-                  LUNAIX_VER,
-                  PLATFORM_TARGET,
-                  __VERSION__,
-                  __DATE__,
-                  __TIME__);
+                  "Lunaix "
+                  CONFIG_LUNAIX_VER
+                  " (gnu-cc " __VERSION__ ") " __DATE__ " " __TIME__);
 }
 
 void
 vfs_export_attributes()
 {
 }
 
 void
 vfs_export_attributes()
 {
-    struct twimap* map = twifs_mapping(NULL, NULL, "mounts");
-    map->read = __mount_read;
-    map->go_next = __mount_next;
-    map->reset = __mount_reset;
-
-    map = twifs_mapping(NULL, NULL, "version");
-    map->read = __version_rd;
-}
\ No newline at end of file
+    twimap_export_list (NULL, mounts,  FSACL_ugR, NULL);
+    twimap_export_value(NULL, version, FSACL_ugR, NULL);
+}
+EXPORT_TWIFS_PLUGIN(vfs_general, vfs_export_attributes);
\ No newline at end of file