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