Blob


1 typedef struct MetaBlock MetaBlock;
2 typedef struct MetaEntry MetaEntry;
4 enum
5 {
6 MaxBlock = (1UL<<31),
7 };
9 enum {
10 BytesPerEntry = 100, /* estimate of bytes per dir entries - determines number of index entries in the block */
11 FullPercentage = 80, /* don't allocate in block if more than this percentage full */
12 FlushSize = 200, /* number of blocks to flush */
13 DirtyPercentage = 50, /* maximum percentage of dirty blocks */
14 };
17 struct MetaEntry
18 {
19 uchar *p;
20 ushort size;
21 };
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 };
34 struct VacDirEnum
35 {
36 VacFile *file;
37 u32int boff;
38 int i, n;
39 VacDir *buf;
40 };
42 void _mbinit(MetaBlock*, u8int*, uint, uint);
43 int _mbsearch(MetaBlock*, char*, int*, MetaEntry*);