Externals/dropbear - Disabled X forwarding
[tpg/acess2.git] / KernelLand / Modules / Filesystems / Ext2 / read.c
index 81f5ee6..c77f06f 100644 (file)
 #define VERBOSE        0
 #include "ext2_common.h"
 
-// === PROTOTYPES ===
-Uint64         Ext2_Read(tVFS_Node *node, Uint64 offset, Uint64 length, void *buffer);
-
 // === CODE ===
 /**
- * \fn Uint64 Ext2_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
  * \brief Read from a file
  */
-Uint64 Ext2_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
+size_t Ext2_Read(tVFS_Node *Node, off_t Offset, size_t Length, void *Buffer, Uint Flags)
 {
        tExt2_Disk      *disk = Node->ImplPtr;
        tExt2_Inode     inode;
@@ -58,6 +54,7 @@ Uint64 Ext2_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
        }
        
        // Read first block
+       // TODO: If (Flags & VFS_IOFLAG_NOBLOCK) trigger read and return EWOULDBLOCK?
        remLen = Length;
        VFS_ReadAt( disk->FD, base + Offset, disk->BlockSize - Offset, Buffer);
        remLen -= disk->BlockSize - Offset;
@@ -69,7 +66,7 @@ Uint64 Ext2_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
        {
                base = Ext2_int_GetBlockAddr(disk, inode.i_block, block);
                if(base == 0) {
-                       Warning("[EXT2 ] NULL Block Detected in INode 0x%llx", Node->Inode);
+                       Log_Warning("EXT2", "NULL Block Detected in INode 0x%llx", Node->Inode);
                        LEAVE('i', 0);
                        return 0;
                }

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