venti-zero.3 (1063B)
1 .TH VENTI-ZERO 3 2 .SH NAME 3 vtzerotruncate, 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 14 uint vtzerotruncate(int type, uchar *buf, uint size) 15 .PP 16 .B 17 void vtzeroextend(int type, uchar *buf, uint size, uint newsize) 18 .PP 19 .B 20 extern uchar vtzeroscore[VtScoreSize]; 21 .SH DESCRIPTION 22 These utility functions compute how to truncate or replace 23 trailing zeros (for data blocks) or trailing zero scores 24 (for pointer blocks) to canonicalize the blocks before 25 storing them to Venti. 26 .PP 27 .I Vtzerotruncate 28 returns the size of the 29 .IR size -byte 30 buffer pointed to by 31 .I buf 32 ignoring trailing zeros or zero scores, 33 according to the given 34 .IR type . 35 .PP 36 .I Vtzeroextend 37 pads 38 .I buf 39 with zeros or zero scores, 40 according to the given 41 .IR type , 42 to grow it from 43 .I size 44 bytes to 45 .I newsize 46 bytes. 47 .PP 48 .I Vtzeroscore 49 is 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 55 .MR venti (3) , 56 .MR venti (7)