6ef9d7c8c3b62cd92112cc1dd5c743e0e6e6f728
[tpg/acess2.git] / Modules / Filesystems / Ext2 / ext2_common.h
1 /*
2  * Acess OS
3  * Ext2 Driver Version 1
4  */
5 /**
6  * \file ext2_common.h
7  * \brief Second Extended Filesystem Driver
8  */
9 #ifndef _EXT2_COMMON_H
10 #define _EXT2_COMMON_H
11 #include <acess.h>
12 #include <vfs.h>
13 #include "ext2fs.h"
14
15 #define EXT2_UPDATE_WRITEBACK   1
16
17 // === STRUCTURES ===
18 typedef struct {
19          int    FD;
20          int    CacheID;
21         tVFS_Node       RootNode;
22         
23         tExt2_SuperBlock        SuperBlock;
24         Uint    BlockSize;
25          
26          int    GroupCount;
27         tExt2_Group             Groups[];
28 } tExt2_Disk;
29
30 // === FUNCTIONS ===
31 // --- Common ---
32 extern void     Ext2_CloseFile(tVFS_Node *Node);
33 extern Uint64   Ext2_int_GetBlockAddr(tExt2_Disk *Disk, Uint32 *Blocks, int BlockNum);
34 extern void     Ext2_int_UpdateSuperblock(tExt2_Disk *Disk);
35 extern int      Ext2_int_ReadInode(tExt2_Disk *Disk, Uint32 InodeId, tExt2_Inode *Inode);
36 extern int      Ext2_int_WriteInode(tExt2_Disk *Disk, Uint32 InodeId, tExt2_Inode *Inode);
37 // --- Dir ---
38 extern char     *Ext2_ReadDir(tVFS_Node *Node, int Pos);
39 extern tVFS_Node        *Ext2_FindDir(tVFS_Node *Node, const char *FileName);
40 extern int      Ext2_MkNod(tVFS_Node *Node, const char *Name, Uint Flags);
41 extern int      Ext2_Link(tVFS_Node *Parent, tVFS_Node *Node, const char *Name);
42 // --- Read ---
43 extern Uint64   Ext2_Read(tVFS_Node *node, Uint64 offset, Uint64 length, void *buffer);
44 // --- Write ---
45 extern Uint64   Ext2_Write(tVFS_Node *node, Uint64 offset, Uint64 length, const void *buffer);
46
47 #endif

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