dat.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 MetaBlock MetaBlock;
  10. typedef struct MetaEntry MetaEntry;
  11. #define MaxBlock (1UL<<31)
  12. enum {
  13. BytesPerEntry = 100, /* estimate of bytes per dir entries - determines number of index entries in the block */
  14. FullPercentage = 80, /* don't allocate in block if more than this percentage full */
  15. FlushSize = 200, /* number of blocks to flush */
  16. DirtyPercentage = 50 /* maximum percentage of dirty blocks */
  17. };
  18. struct MetaEntry
  19. {
  20. uchar *p;
  21. ushort size;
  22. };
  23. struct MetaBlock
  24. {
  25. int maxsize; /* size of block */
  26. int size; /* size used */
  27. int free; /* free space within used size */
  28. int maxindex; /* entries allocated for table */
  29. int nindex; /* amount of table used */
  30. int unbotch;
  31. uchar *buf;
  32. };
  33. struct VacDirEnum
  34. {
  35. VacFile *file;
  36. u32int boff;
  37. int i, n;
  38. VacDir *buf;
  39. };