disk.h 906 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. typedef struct Disk Disk;
  10. /*
  11. * Reference to the disk
  12. */
  13. struct Disk
  14. {
  15. Bcache;
  16. ulong nb; /* number of blocks */
  17. ulong nab; /* number of allocation blocks */
  18. int b2b; /* allocation bits to a block */
  19. int p2b; /* Dptr's per page */
  20. char name[CACHENAMELEN];
  21. };
  22. int dinit(Disk*, int, int, char*);
  23. int dformat(Disk*, int, char*, uint32_t, uint32_t);
  24. uint32_t dalloc(Disk*, Dptr*);
  25. uint32_t dpalloc(Disk*, Dptr*);
  26. int dfree(Disk*, Dptr*);
  27. extern int debug;
  28. #define DPRINT if(debug)fprint