X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FFilesystems%2FRAMDisk%2Framdisk.h;h=4b0ce6c89918720b182a1baf5be329bea3fb6ec7;hb=11dbd684e9a3d907d43d71a3145205f1a86992fb;hp=4692509383a4a514b640a40bbaee97dc0bd91d07;hpb=2479df06d56b576e1e221ebff5a53384ce8bb971;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/Filesystems/RAMDisk/ramdisk.h b/KernelLand/Modules/Filesystems/RAMDisk/ramdisk.h index 46925093..4b0ce6c8 100644 --- a/KernelLand/Modules/Filesystems/RAMDisk/ramdisk.h +++ b/KernelLand/Modules/Filesystems/RAMDisk/ramdisk.h @@ -10,13 +10,15 @@ #include -typedef struct sRAMDisk_Inode tRAMDisk_Inode; -typedef struct sRAMDisk_File tRAMDisk_File; -typedef struct sRAMDisk_DirEnt tRAMDisk_DirEnt; -typedef struct sRAMDisk_Dir tRAMDisk_Dir; +#define RAMFS_NDIRECT 12 + +typedef struct sRAMFS_Inode tRAMFS_Inode; +typedef struct sRAMFS_File tRAMFS_File; +typedef struct sRAMFS_DirEnt tRAMFS_DirEnt; +typedef struct sRAMFS_Dir tRAMFS_Dir; typedef struct sRAMDisk tRAMDisk; -struct sRAMDisk_Inode +struct sRAMFS_Inode { tRAMDisk *Disk; tVFS_Node Node; @@ -24,37 +26,38 @@ struct sRAMDisk_Inode int nLink; }; -struct sRAMDisk_File +struct sRAMFS_File { - tRAMDisk_Inode Inode; + tRAMFS_Inode Inode; size_t Size; int nAllocPageSlots; - Uint32 PagesDirect[12]; + Uint32 PagesDirect[RAMFS_NDIRECT]; Uint32 Indirect1Page; // PAGE_SIZE/sizeof(Uint32) = 1024 on x86 Uint32 Indirect2Page; // ~1 Million on x86 }; -struct sRAMDisk_DirEnt +struct sRAMFS_DirEnt { - tRAMDisk_DirEnt *Next; - tRAMDisk_Inode *Inode; + tRAMFS_DirEnt *Next; + tRAMFS_Inode *Inode; Uint8 NameLen; char Name[]; }; -struct sRAMDisk_Dir +struct sRAMFS_Dir { - tRAMDisk_Inode Inode; + tRAMFS_Inode Inode; - tRAMDisk_DirEnt *FirstEnt; - tRAMDisk_DirEnt *LastEnt; + tRAMFS_DirEnt *FirstEnt; + tRAMFS_DirEnt *LastEnt; }; struct sRAMDisk { - tRAMDisk_Dir RootDir; + tRAMFS_Dir RootDir; int MaxPages; + Uint32 *Bitmap; int nUsedPages; tPAddr PhysPages[]; };