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