1 typedef struct Disk Disk; 2 3 /* 4 * Reference to the disk 5 */ 6 struct Disk 7 { 8 Bcache; 9 ulong nb; /* number of blocks */ 10 ulong nab; /* number of allocation blocks */ 11 int b2b; /* allocation bits to a block */ 12 int p2b; /* Dptr's per page */ 13 char name[CACHENAMELEN]; 14 }; 15 16 int dinit(Disk*, int, int, char*); 17 int dformat(Disk*, int, char*, ulong, ulong); 18 ulong dalloc(Disk*, Dptr*); 19 ulong dpalloc(Disk*, Dptr*); 20 int dfree(Disk*, Dptr*); 21 22 extern int debug; 23 24 #define DPRINT if(debug)fprint 25