blob: 270b768019ecc2864e65cd2da7c09744c85486c8 [file] [log] [blame]
rscbe7cbb42005-07-12 15:24:18 +00001.TH VENTI-ZERO 3
2.SH NAME
3vtzerotruncate, vtzeroextend, vtzeroscore \- Venti block truncation
4.SH SYNOPSIS
5.ft L
6#include <u.h>
7.br
8#include <libc.h>
9.br
10#include <venti.h>
11.ta +\w'\fLuint 'u
12.PP
13.B
14uint vtzerotruncate(int type, uchar *buf, uint size)
15.PP
16.B
17void vtzeroextend(int type, uchar *buf, uint size, uint newsize)
18.PP
19.B
20extern uchar vtzeroscore[VtScoreSize];
21.SH DESCRIPTION
22These utility functions compute how to truncate or replace
23trailing zeros (for data blocks) or trailing zero scores
24(for pointer blocks) to canonicalize the blocks before
25storing them to Venti.
26.PP
27.I Vtzerotruncate
28returns the size of the
29.IR size -byte
30buffer pointed to by
31.I buf
32ignoring trailing zeros or zero scores,
rsc3aec33f2005-07-18 22:41:58 +000033according to the given
rscbe7cbb42005-07-12 15:24:18 +000034.IR type .
35.PP
36.I Vtzeroextend
37pads
38.I buf
39with zeros or zero scores,
rsc3aec33f2005-07-18 22:41:58 +000040according to the given
rscbe7cbb42005-07-12 15:24:18 +000041.IR type ,
42to grow it from
43.I size
44bytes to
45.I newsize
46bytes.
47.PP
48.I Vtzeroscore
49is the score of the zero-length block.
50.SH SOURCE
51.B \*9/src/libventi/zero.c
52.br
53.B \*9/src/libventi/zeroscore.c
54.SH SEE ALSO
rsc3aec33f2005-07-18 22:41:58 +000055.IR venti (3),
56.IR venti (7)