X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FFilesystems%2FExt2%2Fext2_common.h;h=4c8c45e212906e69da04b3d1117d5371c7e7e2bb;hb=04a050f42807686dc119838c82372409246d55bb;hp=036cd59f6e15407e95b8a922282e24657ddb7d4a;hpb=9dccbc6f16485ea62caa8c4153f6f878da8cbb0d;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/Filesystems/Ext2/ext2_common.h b/KernelLand/Modules/Filesystems/Ext2/ext2_common.h index 036cd59f..4c8c45e2 100644 --- a/KernelLand/Modules/Filesystems/Ext2/ext2_common.h +++ b/KernelLand/Modules/Filesystems/Ext2/ext2_common.h @@ -2,10 +2,6 @@ * Acess OS * Ext2 Driver Version 1 */ -/** - * \file ext2_common.h - * \brief Second Extended Filesystem Driver - */ #ifndef _EXT2_COMMON_H #define _EXT2_COMMON_H #include @@ -27,21 +23,32 @@ typedef struct { tExt2_Group Groups[]; } tExt2_Disk; +// === GLOBALS === +extern tVFS_NodeType gExt2_FileType; +extern tVFS_NodeType gExt2_DirType; + // === FUNCTIONS === // --- Common --- extern void Ext2_CloseFile(tVFS_Node *Node); extern Uint64 Ext2_int_GetBlockAddr(tExt2_Disk *Disk, Uint32 *Blocks, int BlockNum); extern void Ext2_int_UpdateSuperblock(tExt2_Disk *Disk); +extern Uint32 Ext2_int_AllocateInode(tExt2_Disk *Disk, Uint32 Parent); +extern void Ext2_int_DereferenceInode(tExt2_Disk *Disk, Uint32 Inode); extern int Ext2_int_ReadInode(tExt2_Disk *Disk, Uint32 InodeId, tExt2_Inode *Inode); extern int Ext2_int_WriteInode(tExt2_Disk *Disk, Uint32 InodeId, tExt2_Inode *Inode); // --- Dir --- -extern char *Ext2_ReadDir(tVFS_Node *Node, int Pos); +extern int Ext2_ReadDir(tVFS_Node *Node, int Pos, char Dest[FILENAME_MAX]); extern tVFS_Node *Ext2_FindDir(tVFS_Node *Node, const char *FileName); -extern int Ext2_MkNod(tVFS_Node *Node, const char *Name, Uint Flags); +extern tVFS_Node *Ext2_MkNod(tVFS_Node *Node, const char *Name, Uint Flags); extern int Ext2_Link(tVFS_Node *Parent, const char *Name, tVFS_Node *Node); +extern tVFS_Node *Ext2_int_CreateNode(tExt2_Disk *Disk, Uint InodeId); +extern int Ext2_int_WritebackNode(tExt2_Disk *Disk, tVFS_Node *Node); // --- Read --- extern size_t Ext2_Read(tVFS_Node *node, off_t offset, size_t length, void *buffer); // --- Write --- extern size_t Ext2_Write(tVFS_Node *node, off_t offset, size_t length, const void *buffer); +extern Uint32 Ext2_int_AllocateBlock(tExt2_Disk *Disk, Uint32 LastBlock); +extern void Ext2_int_DeallocateBlock(tExt2_Disk *Disk, Uint32 Block); +extern int Ext2_int_AppendBlock(tExt2_Disk *Disk, tExt2_Inode *Inode, Uint32 Block); #endif