VFS - Rework to remove function pointers from tVFS_Node
[tpg/acess2.git] / Kernel / vfs / fs / devfs.c
index 098ac4f..b3f4a57 100644 (file)
@@ -8,9 +8,11 @@
 #include <fs_devfs.h>
 
 // === PROTOTYPES ===
+#if 0
  int   DevFS_AddDevice(tDevFS_Driver *Device);
 void   DevFS_DelDevice(tDevFS_Driver *Device);
-tVFS_Node      *DevFS_InitDevice(char *Device, char **Options);
+#endif
+tVFS_Node      *DevFS_InitDevice(const char *Device, const char **Options);
 char   *DevFS_ReadDir(tVFS_Node *Node, int Pos);
 tVFS_Node      *DevFS_FindDir(tVFS_Node *Node, const char *Name);
 
@@ -18,13 +20,17 @@ tVFS_Node   *DevFS_FindDir(tVFS_Node *Node, const char *Name);
 tVFS_Driver    gDevFS_Info = {
        "devfs", 0, DevFS_InitDevice, NULL, NULL
        };
+tVFS_NodeType  gDevFS_DirType = {
+       .TypeName = "DevFS-Dir",
+       .ReadDir = DevFS_ReadDir,
+       .FindDir = DevFS_FindDir
+       };
 tVFS_Node      gDevFS_RootNode = {
        .Size = 0,
        .Flags = VFS_FFLAG_DIRECTORY,
        .NumACLs = 1,
        .ACLs = &gVFS_ACL_EveryoneRX,
-       .ReadDir = DevFS_ReadDir,
-       .FindDir = DevFS_FindDir
+       .Type = &gDevFS_DirType
        };
 tDevFS_Driver  *gDevFS_Drivers = NULL;
  int   giDevFS_NextID = 1;
@@ -98,11 +104,10 @@ void DevFS_DelDevice(tDevFS_Driver *Device)
 }
 
 /**
- * \fn tVFS_Node *DevFS_InitDevice(char *Device, char **Options)
  * \brief Initialise the DevFS and detect double-mounting, or just do nothing
  * \note STUB
  */
-tVFS_Node *DevFS_InitDevice(char *Device, char **Options)
+tVFS_Node *DevFS_InitDevice(const char *Device, const char **Options)
 {
        return &gDevFS_RootNode;
 }
@@ -128,7 +133,7 @@ char *DevFS_ReadDir(tVFS_Node *Node, int Pos)
 }
 
 /**
- * \fn tVFS_Node *DevFS_FindDir(tVFS_Node *Node, char *Name)
+ * \fn tVFS_Node *DevFS_FindDir(tVFS_Node *Node, const char *Name)
  * \brief Get an entry from the devices directory
  */
 tVFS_Node *DevFS_FindDir(tVFS_Node *Node, const char *Name)

UCC git Repository :: git.ucc.asn.au