disk.h 467 B

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