1 f7012583 2003-11-25 devnull #ifndef _VENTI_H_
2 f7012583 2003-11-25 devnull #define _VENTI_H_ 1
3 819822c9 2004-06-16 devnull #ifdef __cplusplus
4 f7012583 2003-11-25 devnull extern "C" {
7 6c0209f6 2005-02-11 devnull #ifndef PLAN9PORT
8 6c0209f6 2005-02-11 devnull #pragma lib "libventi.a"
9 6c0209f6 2005-02-11 devnull #pragma src "/sys/src/libventi"
12 1a0954ab 2005-01-04 devnull AUTOLIB(venti)
14 97a5e5f2 2003-11-23 devnull /* XXX should be own library? */
16 97a5e5f2 2003-11-23 devnull * Packets
20 97a5e5f2 2003-11-23 devnull MaxFragSize = 9*1024,
23 97a5e5f2 2003-11-23 devnull typedef struct Packet Packet;
24 97a5e5f2 2003-11-23 devnull Packet *packetalloc(void);
25 97a5e5f2 2003-11-23 devnull void packetfree(Packet*);
26 97a5e5f2 2003-11-23 devnull Packet *packetforeign(uchar *buf, int n, void (*free)(void *a), void *a);
27 97a5e5f2 2003-11-23 devnull Packet *packetdup(Packet*, int offset, int n);
28 97a5e5f2 2003-11-23 devnull Packet *packetsplit(Packet*, int n);
29 97a5e5f2 2003-11-23 devnull int packetconsume(Packet*, uchar *buf, int n);
30 97a5e5f2 2003-11-23 devnull int packettrim(Packet*, int offset, int n);
31 97a5e5f2 2003-11-23 devnull uchar *packetheader(Packet*, int n);
32 97a5e5f2 2003-11-23 devnull uchar *packettrailer(Packet*, int n);
33 d23a617a 2004-03-15 devnull void packetprefix(Packet*, uchar *buf, int n);
34 d23a617a 2004-03-15 devnull void packetappend(Packet*, uchar *buf, int n);
35 d23a617a 2004-03-15 devnull void packetconcat(Packet*, Packet*);
36 97a5e5f2 2003-11-23 devnull uchar *packetpeek(Packet*, uchar *buf, int offset, int n);
37 97a5e5f2 2003-11-23 devnull int packetcopy(Packet*, uchar *buf, int offset, int n);
38 97a5e5f2 2003-11-23 devnull int packetfragments(Packet*, IOchunk*, int nio, int offset);
39 97a5e5f2 2003-11-23 devnull uint packetsize(Packet*);
40 97a5e5f2 2003-11-23 devnull uint packetasize(Packet*);
41 97a5e5f2 2003-11-23 devnull int packetcompact(Packet*);
42 97a5e5f2 2003-11-23 devnull int packetcmp(Packet*, Packet*);
43 97a5e5f2 2003-11-23 devnull void packetstats(void);
44 97a5e5f2 2003-11-23 devnull void packetsha1(Packet*, uchar sha1[20]);
46 6c0209f6 2005-02-11 devnull /* XXX should be own library? */
48 6c0209f6 2005-02-11 devnull * Logging
50 6c0209f6 2005-02-11 devnull typedef struct VtLog VtLog;
51 6c0209f6 2005-02-11 devnull typedef struct VtLogChunk VtLogChunk;
53 6c0209f6 2005-02-11 devnull struct VtLog
55 6c0209f6 2005-02-11 devnull VtLog *next; /* in hash table */
56 587f8f4d 2005-02-13 devnull char *name;
57 6c0209f6 2005-02-11 devnull VtLogChunk *chunk;
58 6c0209f6 2005-02-11 devnull uint nchunk;
59 6c0209f6 2005-02-11 devnull VtLogChunk *w;
60 6c0209f6 2005-02-11 devnull QLock lk;
64 587f8f4d 2005-02-13 devnull struct VtLogChunk
67 587f8f4d 2005-02-13 devnull char *ep;
68 587f8f4d 2005-02-13 devnull char *wp;
71 6c0209f6 2005-02-11 devnull VtLog *vtlogopen(char *name, uint size);
72 6c0209f6 2005-02-11 devnull void vtlogprint(VtLog *log, char *fmt, ...);
73 6c0209f6 2005-02-11 devnull void vtlog(char *name, char *fmt, ...);
74 587f8f4d 2005-02-13 devnull void vtlogclose(VtLog*);
75 6c0209f6 2005-02-11 devnull void vtlogremove(char *name);
76 1c485dae 2005-05-12 devnull char **vtlognames(int*);
77 587f8f4d 2005-02-13 devnull void vtlogdump(int fd, VtLog*);
79 6c0209f6 2005-02-11 devnull /* XXX begin actual venti.h */
81 97a5e5f2 2003-11-23 devnull typedef struct VtFcall VtFcall;
82 97a5e5f2 2003-11-23 devnull typedef struct VtConn VtConn;
83 97a5e5f2 2003-11-23 devnull typedef struct VtEntry VtEntry;
84 97a5e5f2 2003-11-23 devnull typedef struct VtRoot VtRoot;
87 97a5e5f2 2003-11-23 devnull * Fundamental constants.
91 97a5e5f2 2003-11-23 devnull VtScoreSize = 20,
92 97a5e5f2 2003-11-23 devnull VtMaxStringSize = 1024,
93 97a5e5f2 2003-11-23 devnull VtMaxLumpSize = 56*1024,
94 97a5e5f2 2003-11-23 devnull VtPointerDepth = 7,
96 2db9e482 2003-11-24 devnull #define VtMaxFileSize ((1ULL<<48)-1)
100 97a5e5f2 2003-11-23 devnull * Strings in packets.
102 97a5e5f2 2003-11-23 devnull int vtputstring(Packet*, char*);
103 97a5e5f2 2003-11-23 devnull int vtgetstring(Packet*, char**);
106 97a5e5f2 2003-11-23 devnull * Block types.
108 97a5e5f2 2003-11-23 devnull * The initial Venti protocol had a much
109 97a5e5f2 2003-11-23 devnull * less regular list of block types.
110 97a5e5f2 2003-11-23 devnull * VtToDiskType converts from new to old.
114 97a5e5f2 2003-11-23 devnull VtDataType = 0<<3,
115 97a5e5f2 2003-11-23 devnull /* VtDataType+1, ... */
116 97a5e5f2 2003-11-23 devnull VtDirType = 1<<3,
117 97a5e5f2 2003-11-23 devnull /* VtDirType+1, ... */
118 97a5e5f2 2003-11-23 devnull VtRootType = 2<<3,
119 97a5e5f2 2003-11-23 devnull VtMaxType,
120 d3232caf 2004-06-14 devnull VtCorruptType = 0xFF,
122 97a5e5f2 2003-11-23 devnull VtTypeDepthMask = 7,
123 d23a617a 2004-03-15 devnull VtTypeBaseMask = ~VtTypeDepthMask,
126 97a5e5f2 2003-11-23 devnull /* convert to/from on-disk type numbers */
127 97a5e5f2 2003-11-23 devnull uint vttodisktype(uint);
128 97a5e5f2 2003-11-23 devnull uint vtfromdisktype(uint);
131 97a5e5f2 2003-11-23 devnull * VtEntry describes a Venti stream
133 eacbfb24 2004-03-15 devnull * The _ enums are only used on the wire.
134 eacbfb24 2004-03-15 devnull * They are not present in the VtEntry structure
135 eacbfb24 2004-03-15 devnull * and should not be used by client programs.
136 eacbfb24 2004-03-15 devnull * (The info is in the type field.)
140 97a5e5f2 2003-11-23 devnull VtEntryActive = 1<<0, /* entry is in use */
141 d23a617a 2004-03-15 devnull _VtEntryDir = 1<<1, /* a directory */
142 d23a617a 2004-03-15 devnull _VtEntryDepthShift = 2, /* shift for pointer depth */
143 d23a617a 2004-03-15 devnull _VtEntryDepthMask = 7<<2, /* mask for pointer depth */
144 97a5e5f2 2003-11-23 devnull VtEntryLocal = 1<<5, /* for local storage only */
148 97a5e5f2 2003-11-23 devnull VtEntrySize = 40,
150 97a5e5f2 2003-11-23 devnull struct VtEntry
152 97a5e5f2 2003-11-23 devnull ulong gen; /* generation number */
153 97a5e5f2 2003-11-23 devnull ushort psize; /* pointer block size */
154 97a5e5f2 2003-11-23 devnull ushort dsize; /* data block size */
155 97a5e5f2 2003-11-23 devnull uchar type;
156 97a5e5f2 2003-11-23 devnull uchar flags;
157 97a5e5f2 2003-11-23 devnull uvlong size;
158 97a5e5f2 2003-11-23 devnull uchar score[VtScoreSize];
161 97a5e5f2 2003-11-23 devnull void vtentrypack(VtEntry*, uchar*, int index);
162 97a5e5f2 2003-11-23 devnull int vtentryunpack(VtEntry*, uchar*, int index);
164 97a5e5f2 2003-11-23 devnull struct VtRoot
166 97a5e5f2 2003-11-23 devnull char name[128];
167 97a5e5f2 2003-11-23 devnull char type[128];
168 97a5e5f2 2003-11-23 devnull uchar score[VtScoreSize]; /* to a Dir block */
169 97a5e5f2 2003-11-23 devnull ushort blocksize; /* maximum block size */
170 97a5e5f2 2003-11-23 devnull uchar prev[VtScoreSize]; /* last root block */
175 97a5e5f2 2003-11-23 devnull VtRootSize = 300,
176 97a5e5f2 2003-11-23 devnull VtRootVersion = 2,
179 97a5e5f2 2003-11-23 devnull void vtrootpack(VtRoot*, uchar*);
180 97a5e5f2 2003-11-23 devnull int vtrootunpack(VtRoot*, uchar*);
183 97a5e5f2 2003-11-23 devnull * score of zero length block
185 97a5e5f2 2003-11-23 devnull extern uchar vtzeroscore[VtScoreSize];
188 97a5e5f2 2003-11-23 devnull * zero extend and truncate blocks
190 97a5e5f2 2003-11-23 devnull void vtzeroextend(int type, uchar *buf, uint n, uint nn);
191 97a5e5f2 2003-11-23 devnull uint vtzerotruncate(int type, uchar *buf, uint n);
194 97a5e5f2 2003-11-23 devnull * parse score: mungs s
196 d23a617a 2004-03-15 devnull int vtparsescore(char *s, char **prefix, uchar[VtScoreSize]);
199 97a5e5f2 2003-11-23 devnull * formatting
200 97a5e5f2 2003-11-23 devnull * other than noted, these formats all ignore
201 97a5e5f2 2003-11-23 devnull * the width and precision arguments, and all flags
203 97a5e5f2 2003-11-23 devnull * V a venti score
205 819822c9 2004-06-16 devnull #ifndef PLAN9PORT
206 819822c9 2004-06-16 devnull #pragma varargck type "V" uchar*
207 819822c9 2004-06-16 devnull #pragma varargck type "F" VtFcall*
210 97a5e5f2 2003-11-23 devnull int vtscorefmt(Fmt*);
213 97a5e5f2 2003-11-23 devnull * error-checking malloc et al.
215 97a5e5f2 2003-11-23 devnull void vtfree(void *);
216 97a5e5f2 2003-11-23 devnull void *vtmalloc(int);
217 97a5e5f2 2003-11-23 devnull void *vtmallocz(int);
218 97a5e5f2 2003-11-23 devnull void *vtrealloc(void *p, int);
219 97a5e5f2 2003-11-23 devnull void *vtbrk(int n);
220 97a5e5f2 2003-11-23 devnull char *vtstrdup(char *);
223 97a5e5f2 2003-11-23 devnull * Venti protocol
227 97a5e5f2 2003-11-23 devnull * Crypto strengths
231 97a5e5f2 2003-11-23 devnull VtCryptoStrengthNone,
232 97a5e5f2 2003-11-23 devnull VtCryptoStrengthAuth,
233 97a5e5f2 2003-11-23 devnull VtCryptoStrengthWeak,
234 97a5e5f2 2003-11-23 devnull VtCryptoStrengthStrong,
238 97a5e5f2 2003-11-23 devnull * Crypto suites
242 97a5e5f2 2003-11-23 devnull VtCryptoNone,
243 97a5e5f2 2003-11-23 devnull VtCryptoSSL3,
244 97a5e5f2 2003-11-23 devnull VtCryptoTLS1,
245 97a5e5f2 2003-11-23 devnull VtCryptoMax,
249 97a5e5f2 2003-11-23 devnull * Codecs
253 97a5e5f2 2003-11-23 devnull VtCodecNone,
254 97a5e5f2 2003-11-23 devnull VtCodecDeflate,
255 97a5e5f2 2003-11-23 devnull VtCodecThwack,
256 97a5e5f2 2003-11-23 devnull VtCodecMax
261 97a5e5f2 2003-11-23 devnull VtRerror = 1,
262 97a5e5f2 2003-11-23 devnull VtTping = 2,
263 97a5e5f2 2003-11-23 devnull VtRping,
264 97a5e5f2 2003-11-23 devnull VtThello = 4,
265 97a5e5f2 2003-11-23 devnull VtRhello,
266 97a5e5f2 2003-11-23 devnull VtTgoodbye = 6,
267 97a5e5f2 2003-11-23 devnull VtRgoodbye, /* not used */
268 97a5e5f2 2003-11-23 devnull VtTauth0 = 8,
269 97a5e5f2 2003-11-23 devnull VtRauth0,
270 97a5e5f2 2003-11-23 devnull VtTauth1 = 10,
271 97a5e5f2 2003-11-23 devnull VtRauth1,
272 97a5e5f2 2003-11-23 devnull VtTread = 12,
273 97a5e5f2 2003-11-23 devnull VtRread,
274 97a5e5f2 2003-11-23 devnull VtTwrite = 14,
275 97a5e5f2 2003-11-23 devnull VtRwrite,
276 97a5e5f2 2003-11-23 devnull VtTsync = 16,
277 97a5e5f2 2003-11-23 devnull VtRsync,
282 97a5e5f2 2003-11-23 devnull struct VtFcall
284 7e6f40b2 2005-07-13 devnull uchar msgtype;
285 97a5e5f2 2003-11-23 devnull uchar tag;
287 97a5e5f2 2003-11-23 devnull char *error; /* Rerror */
289 97a5e5f2 2003-11-23 devnull char *version; /* Thello */
290 97a5e5f2 2003-11-23 devnull char *uid; /* Thello */
291 97a5e5f2 2003-11-23 devnull uchar strength; /* Thello */
292 97a5e5f2 2003-11-23 devnull uchar *crypto; /* Thello */
293 97a5e5f2 2003-11-23 devnull uint ncrypto; /* Thello */
294 97a5e5f2 2003-11-23 devnull uchar *codec; /* Thello */
295 97a5e5f2 2003-11-23 devnull uint ncodec; /* Thello */
296 97a5e5f2 2003-11-23 devnull char *sid; /* Rhello */
297 97a5e5f2 2003-11-23 devnull uchar rcrypto; /* Rhello */
298 97a5e5f2 2003-11-23 devnull uchar rcodec; /* Rhello */
299 97a5e5f2 2003-11-23 devnull uchar *auth; /* TauthX, RauthX */
300 97a5e5f2 2003-11-23 devnull uint nauth; /* TauthX, RauthX */
301 97a5e5f2 2003-11-23 devnull uchar score[VtScoreSize]; /* Tread, Rwrite */
302 7e6f40b2 2005-07-13 devnull uchar blocktype; /* Tread, Twrite */
303 97a5e5f2 2003-11-23 devnull ushort count; /* Tread */
304 97a5e5f2 2003-11-23 devnull Packet *data; /* Rread, Twrite */
307 97a5e5f2 2003-11-23 devnull Packet *vtfcallpack(VtFcall*);
308 97a5e5f2 2003-11-23 devnull int vtfcallunpack(VtFcall*, Packet*);
309 97a5e5f2 2003-11-23 devnull void vtfcallclear(VtFcall*);
310 97a5e5f2 2003-11-23 devnull int vtfcallfmt(Fmt*);
314 97a5e5f2 2003-11-23 devnull VtStateAlloc,
315 97a5e5f2 2003-11-23 devnull VtStateConnected,
316 97a5e5f2 2003-11-23 devnull VtStateClosed,
319 97a5e5f2 2003-11-23 devnull struct VtConn
321 97a5e5f2 2003-11-23 devnull QLock lk;
322 97a5e5f2 2003-11-23 devnull QLock inlk;
323 97a5e5f2 2003-11-23 devnull QLock outlk;
324 97a5e5f2 2003-11-23 devnull int debug;
325 97a5e5f2 2003-11-23 devnull int infd;
326 97a5e5f2 2003-11-23 devnull int outfd;
327 97a5e5f2 2003-11-23 devnull int muxer;
328 97a5e5f2 2003-11-23 devnull void *writeq;
329 97a5e5f2 2003-11-23 devnull void *readq;
330 97a5e5f2 2003-11-23 devnull int state;
331 97a5e5f2 2003-11-23 devnull void *wait[256];
332 97a5e5f2 2003-11-23 devnull uint ntag;
333 97a5e5f2 2003-11-23 devnull uint nsleep;
334 97a5e5f2 2003-11-23 devnull Packet *part;
335 97a5e5f2 2003-11-23 devnull Rendez tagrend;
336 97a5e5f2 2003-11-23 devnull Rendez rpcfork;
337 97a5e5f2 2003-11-23 devnull char *version;
338 97a5e5f2 2003-11-23 devnull char *uid;
339 97a5e5f2 2003-11-23 devnull char *sid;
340 587f8f4d 2005-02-13 devnull char addr[256]; /* address of other side */
343 97a5e5f2 2003-11-23 devnull VtConn *vtconn(int infd, int outfd);
344 97a5e5f2 2003-11-23 devnull VtConn *vtdial(char*);
345 97a5e5f2 2003-11-23 devnull void vtfreeconn(VtConn*);
346 97a5e5f2 2003-11-23 devnull int vtsend(VtConn*, Packet*);
347 97a5e5f2 2003-11-23 devnull Packet *vtrecv(VtConn*);
348 97a5e5f2 2003-11-23 devnull int vtversion(VtConn *z);
349 97a5e5f2 2003-11-23 devnull void vtdebug(VtConn *z, char*, ...);
350 97a5e5f2 2003-11-23 devnull void vthangup(VtConn *z);
351 97a5e5f2 2003-11-23 devnull /* #pragma varargck argpos vtdebug 2 */
353 97a5e5f2 2003-11-23 devnull /* server */
354 97a5e5f2 2003-11-23 devnull typedef struct VtSrv VtSrv;
355 97a5e5f2 2003-11-23 devnull typedef struct VtReq VtReq;
356 97a5e5f2 2003-11-23 devnull struct VtReq
358 97a5e5f2 2003-11-23 devnull VtFcall tx;
359 97a5e5f2 2003-11-23 devnull VtFcall rx;
360 97a5e5f2 2003-11-23 devnull /* private */
361 97a5e5f2 2003-11-23 devnull VtSrv *srv;
362 97a5e5f2 2003-11-23 devnull void *sc;
365 97a5e5f2 2003-11-23 devnull int vtsrvhello(VtConn*);
366 97a5e5f2 2003-11-23 devnull VtSrv *vtlisten(char *addr);
367 97a5e5f2 2003-11-23 devnull VtReq *vtgetreq(VtSrv*);
368 97a5e5f2 2003-11-23 devnull void vtrespond(VtReq*);
370 97a5e5f2 2003-11-23 devnull /* client */
371 97a5e5f2 2003-11-23 devnull Packet *vtrpc(VtConn*, Packet*);
372 7252036f 2005-11-02 devnull Packet *_vtrpc(VtConn*, Packet*, VtFcall*);
373 97a5e5f2 2003-11-23 devnull void vtrecvproc(void*); /* VtConn* */
374 97a5e5f2 2003-11-23 devnull void vtsendproc(void*); /* VtConn* */
376 97a5e5f2 2003-11-23 devnull int vtconnect(VtConn*);
377 97a5e5f2 2003-11-23 devnull int vthello(VtConn*);
378 97a5e5f2 2003-11-23 devnull int vtread(VtConn*, uchar score[VtScoreSize], uint type, uchar *buf, int n);
379 97a5e5f2 2003-11-23 devnull int vtwrite(VtConn*, uchar score[VtScoreSize], uint type, uchar *buf, int n);
380 97a5e5f2 2003-11-23 devnull Packet *vtreadpacket(VtConn*, uchar score[VtScoreSize], uint type, int n);
381 97a5e5f2 2003-11-23 devnull int vtwritepacket(VtConn*, uchar score[VtScoreSize], uint type, Packet *p);
382 97a5e5f2 2003-11-23 devnull int vtsync(VtConn*);
383 97a5e5f2 2003-11-23 devnull int vtping(VtConn*);
386 97a5e5f2 2003-11-23 devnull * Data blocks and block cache.
390 97a5e5f2 2003-11-23 devnull NilBlock = ~0,
393 97a5e5f2 2003-11-23 devnull typedef struct VtBlock VtBlock;
394 97a5e5f2 2003-11-23 devnull typedef struct VtCache VtCache;
396 97a5e5f2 2003-11-23 devnull struct VtBlock
398 97a5e5f2 2003-11-23 devnull VtCache *c;
399 97a5e5f2 2003-11-23 devnull QLock lk;
401 97a5e5f2 2003-11-23 devnull uchar *data;
402 97a5e5f2 2003-11-23 devnull uchar score[VtScoreSize];
403 97a5e5f2 2003-11-23 devnull uchar type; /* BtXXX */
405 97a5e5f2 2003-11-23 devnull /* internal to cache */
406 97a5e5f2 2003-11-23 devnull int nlock;
407 97a5e5f2 2003-11-23 devnull int iostate;
408 97a5e5f2 2003-11-23 devnull int ref;
409 97a5e5f2 2003-11-23 devnull u32int heap;
410 97a5e5f2 2003-11-23 devnull VtBlock *next;
411 97a5e5f2 2003-11-23 devnull VtBlock **prev;
412 97a5e5f2 2003-11-23 devnull u32int used;
413 97a5e5f2 2003-11-23 devnull u32int used2;
414 97a5e5f2 2003-11-23 devnull u32int addr;
417 97a5e5f2 2003-11-23 devnull u32int vtglobaltolocal(uchar[VtScoreSize]);
418 97a5e5f2 2003-11-23 devnull void vtlocaltoglobal(u32int, uchar[VtScoreSize]);
420 88dc23ae 2005-07-13 devnull VtCache *vtcachealloc(VtConn*, int blocksize, ulong nblocks);
421 97a5e5f2 2003-11-23 devnull void vtcachefree(VtCache*);
422 97a5e5f2 2003-11-23 devnull VtBlock *vtcachelocal(VtCache*, u32int addr, int type);
423 97a5e5f2 2003-11-23 devnull VtBlock *vtcacheglobal(VtCache*, uchar[VtScoreSize], int type);
424 97a5e5f2 2003-11-23 devnull VtBlock *vtcacheallocblock(VtCache*, int type);
425 b98ae9bf 2004-06-17 devnull void vtcachesetwrite(VtCache*, int(*)(VtConn*,uchar[VtScoreSize],uint,uchar*,int));
426 97a5e5f2 2003-11-23 devnull void vtblockput(VtBlock*);
427 97a5e5f2 2003-11-23 devnull u32int vtcacheblocksize(VtCache*);
428 97a5e5f2 2003-11-23 devnull int vtblockwrite(VtBlock*);
429 97a5e5f2 2003-11-23 devnull VtBlock *vtblockcopy(VtBlock*);
430 97a5e5f2 2003-11-23 devnull void vtblockduplock(VtBlock*);
432 7252036f 2005-11-02 devnull extern int vtcachencopy, vtcachenread, vtcachenwrite;
435 97a5e5f2 2003-11-23 devnull * Hash tree file tree.
437 97a5e5f2 2003-11-23 devnull typedef struct VtFile VtFile;
438 d23a617a 2004-03-15 devnull struct VtFile
440 d23a617a 2004-03-15 devnull QLock lk;
441 d23a617a 2004-03-15 devnull int ref;
442 d23a617a 2004-03-15 devnull int local;
443 d23a617a 2004-03-15 devnull VtBlock *b; /* block containing this file */
444 d23a617a 2004-03-15 devnull uchar score[VtScoreSize]; /* score of block containing this file */
446 d23a617a 2004-03-15 devnull /* immutable */
447 d23a617a 2004-03-15 devnull VtCache *c;
448 d23a617a 2004-03-15 devnull int mode;
449 d23a617a 2004-03-15 devnull u32int gen;
450 d23a617a 2004-03-15 devnull int dsize;
451 2e3b8096 2005-07-13 devnull int psize;
452 d23a617a 2004-03-15 devnull int dir;
453 d23a617a 2004-03-15 devnull VtFile *parent;
454 d23a617a 2004-03-15 devnull int epb; /* entries per block in parent */
455 d23a617a 2004-03-15 devnull u32int offset; /* entry offset in parent */
460 97a5e5f2 2003-11-23 devnull VtOREAD,
461 97a5e5f2 2003-11-23 devnull VtOWRITE,
462 97a5e5f2 2003-11-23 devnull VtORDWR,
465 97a5e5f2 2003-11-23 devnull VtFile *vtfileopenroot(VtCache*, VtEntry*);
466 97a5e5f2 2003-11-23 devnull VtFile *vtfilecreateroot(VtCache*, int psize, int dsize, int type);
467 97a5e5f2 2003-11-23 devnull VtFile *vtfileopen(VtFile*, u32int, int);
468 97a5e5f2 2003-11-23 devnull VtFile *vtfilecreate(VtFile*, int psize, int dsize, int dir);
469 23fb2edb 2005-07-24 devnull VtFile *_vtfilecreate(VtFile*, int offset, int psize, int dsize, int dir);
470 97a5e5f2 2003-11-23 devnull VtBlock *vtfileblock(VtFile*, u32int, int mode);
471 97a5e5f2 2003-11-23 devnull long vtfileread(VtFile*, void*, long, vlong);
472 97a5e5f2 2003-11-23 devnull long vtfilewrite(VtFile*, void*, long, vlong);
473 97a5e5f2 2003-11-23 devnull int vtfileflush(VtFile*);
474 97a5e5f2 2003-11-23 devnull void vtfileincref(VtFile*);
475 97a5e5f2 2003-11-23 devnull void vtfileclose(VtFile*);
476 97a5e5f2 2003-11-23 devnull int vtfilegetentry(VtFile*, VtEntry*);
477 d23a617a 2004-03-15 devnull int vtfilesetentry(VtFile*, VtEntry*);
478 97a5e5f2 2003-11-23 devnull int vtfileblockscore(VtFile*, u32int, uchar[VtScoreSize]);
479 97a5e5f2 2003-11-23 devnull u32int vtfilegetdirsize(VtFile*);
480 97a5e5f2 2003-11-23 devnull int vtfilesetdirsize(VtFile*, u32int);
481 97a5e5f2 2003-11-23 devnull void vtfileunlock(VtFile*);
482 97a5e5f2 2003-11-23 devnull int vtfilelock(VtFile*, int);
483 97a5e5f2 2003-11-23 devnull int vtfilelock2(VtFile*, VtFile*, int);
484 3f6a501b 2005-12-30 devnull int vtfileflushbefore(VtFile*, u64int);
485 d23a617a 2004-03-15 devnull int vtfiletruncate(VtFile*);
486 d23a617a 2004-03-15 devnull uvlong vtfilegetsize(VtFile*);
487 3f6a501b 2005-12-30 devnull int vtfilesetsize(VtFile*, u64int);
488 d23a617a 2004-03-15 devnull int vtfileremove(VtFile*);
490 a09e80f9 2004-05-23 devnull extern int chattyventi;
491 a09e80f9 2004-05-23 devnull extern int ventidoublechecksha1;
492 5810cad0 2005-02-15 devnull extern int ventilogging;
494 587f8f4d 2005-02-13 devnull extern char *VtServerLog;
496 819822c9 2004-06-16 devnull #ifdef __cplusplus