Modules/Ext2 - Fixed not unlocking node lock for non-cached node (e.g. root)
[tpg/acess2.git] / KernelLand / Modules / Filesystems / InitRD / main.c
index b52ab8d..863a24a 100644 (file)
@@ -5,7 +5,7 @@
 #include "initrd.h"
 #include <modules.h>
 
-#define DUMP_ON_MOUNT  1
+#define DUMP_ON_MOUNT  0
 
 // === IMPORTS ==
 extern tVFS_Node       gInitRD_RootNode;
@@ -17,7 +17,7 @@ extern tVFS_Node * const      gInitRD_FileList[];
 tVFS_Node      *InitRD_InitDevice(const char *Device, const char **Arguments);
 void   InitRD_Unmount(tVFS_Node *Node);
 tVFS_Node      *InitRD_GetNodeFromINode(tVFS_Node *Root, Uint64 Inode);
-Uint64 InitRD_ReadFile(tVFS_Node *Node, Uint64 Offset, Uint64 Size, void *Buffer);
+size_t InitRD_ReadFile(tVFS_Node *Node, off_t Offset, size_t Size, void *Buffer);
 char   *InitRD_ReadDir(tVFS_Node *Node, int ID);
 tVFS_Node      *InitRD_FindDir(tVFS_Node *Node, const char *Name);
 void   InitRD_DumpDir(tVFS_Node *Node, int Indent);
@@ -25,10 +25,13 @@ void        InitRD_DumpDir(tVFS_Node *Node, int Indent);
 // === GLOBALS ===
 MODULE_DEFINE(0, 0x0A, FS_InitRD, InitRD_Install, NULL);
 tVFS_Driver    gInitRD_FSInfo = {
-       "initrd", 0, InitRD_InitDevice, InitRD_Unmount, InitRD_GetNodeFromINode
+       .Name = "initrd",
+       .InitDevice = InitRD_InitDevice,
+       .Unmount = InitRD_Unmount,
+       .GetNodeFromINode = InitRD_GetNodeFromINode
        };
 tVFS_NodeType  gInitRD_DirType = {
-       .ReadDir = InitRD_ReadFile,
+       .ReadDir = InitRD_ReadDir,
        .FindDir = InitRD_FindDir
        };
 tVFS_NodeType  gInitRD_FileType = {
@@ -40,7 +43,6 @@ tVFS_NodeType gInitRD_FileType = {
  */
 int InitRD_Install(char **Arguments)
 {
-       Log_Notice("InitRD", "Installed");
        VFS_AddDriver( &gInitRD_FSInfo );
        
        return MODULE_ERR_OK;
@@ -54,7 +56,6 @@ tVFS_Node *InitRD_InitDevice(const char *Device, const char **Arguments)
        #if DUMP_ON_MOUNT
        InitRD_DumpDir( &gInitRD_RootNode, 0 );
        #endif
-       Log_Notice("InitRD", "Mounted (%i files)", giInitRD_NumFiles);
        return &gInitRD_RootNode;
 }
 
@@ -76,7 +77,7 @@ tVFS_Node *InitRD_GetNodeFromINode(tVFS_Node *Root, Uint64 Inode)
 /**
  * \brief Read from a file
  */
-Uint64 InitRD_ReadFile(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
+size_t InitRD_ReadFile(tVFS_Node *Node, off_t Offset, size_t Length, void *Buffer)
 {
        if(Offset > Node->Size)
                return 0;

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