X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FFilesystems%2FRAMDisk%2Framdisk.h;h=4b0ce6c89918720b182a1baf5be329bea3fb6ec7;hb=04a050f42807686dc119838c82372409246d55bb;hp=0765d08f9e626f6a8a191a2d1c559fb71af770a7;hpb=00261f74aca198568e8664d89e30f6cb04785bc2;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/Filesystems/RAMDisk/ramdisk.h b/KernelLand/Modules/Filesystems/RAMDisk/ramdisk.h index 0765d08f..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,35 +26,35 @@ 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;