changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > ventivac / changeset: document Entry and Root in venti(2)

changeset 145: 735de23113c5
parent 144: 207beea1188c
child 146: 2f5a91bbd2af
author: Mechiel Lukkien <>
date: Thu, 30 Aug 2007 15:35:06 +0200
files: TODO man/2/venti
description: document Entry and Root in venti(2)
     1.1--- a/TODO	Thu Aug 30 14:13:56 2007 +0200
     1.2+++ b/TODO	Thu Aug 30 15:35:06 2007 +0200
     1.3@@ -1,5 +1,4 @@
     1.4 things left to do (maybe):
     1.5-- update manual page for venti.m? (describe Entry and Root)
     1.6 - manual page for vac.m?
     1.7 - some more testing
     1.8 - look at memory requirements for vacfs and its qid caching
     2.1--- a/man/2/venti	Thu Aug 30 14:13:56 2007 +0200
     2.2+++ b/man/2/venti	Thu Aug 30 15:35:06 2007 +0200
     2.3@@ -5,7 +5,7 @@
     2.4 .EX
     2.5 include "venti.m";
     2.6 venti := load Venti Venti->PATH;
     2.7-Session: import venti;
     2.8+Session, Entry, Root: import venti;
    2.10 init:			fn();
    2.12@@ -24,6 +24,17 @@
    2.13 	zero:		fn(): Score;
    2.14 };
    2.16+Entry: adt {
    2.17+	new:	fn(psize, dsize, flags: int, size: big, score: Venti->Score): ref Entry;
    2.18+	pack:	fn(e: self ref Entry): array of byte;
    2.19+	unpack:	fn(d: array of byte): ref Entry;
    2.22+Root: adt {
    2.23+	new:	fn(name, rtype: string, score: Venti->Score, blocksize: int, prev: ref Venti->Score): ref Root;
    2.24+	unpack:	fn(d: array of byte): ref Root;
    2.25+	pack:	fn(r: self ref Root): array of byte;
    2.27 .EE
    2.29 .I Venti
    2.30@@ -46,7 +57,7 @@
    2.31 facilitating recovery in the event of corruption.
    2.32 A
    2.33 .B Session
    2.34-represents an session with a Venti server.
    2.35+represents a session with a Venti server.
    2.36 .TP
    2.37 .IB s .new(\fIfd\fP)
    2.38 .B New
    2.39@@ -96,5 +107,102 @@
    2.40 .B Sync
    2.41 tells the Venti server to make sure that all data is committed to
    2.42 active storage.
    2.45+.B Entry
    2.46+represents a hash tree stored in Venti.
    2.48+.IB e .new(\fIpsize\fP,\ \fIdsize\fP,\ \fIflags\fP,\ \fIsize\fP,\ \fIscore\fP)
    2.49+Creates a new Entry data structure.
    2.50+.I Psize
    2.52+.I dsize
    2.53+are the sizes of pointer and data blocks.
    2.54+.I Flags
    2.55+holds bits representing the type of the
    2.56+.IR Entry .
    2.58+.I Entryactive
    2.59+tells the entry is valid.  If this bit is absent, the
    2.60+.I Entry
    2.61+should be ignored when it occurs in a Venti directory.
    2.63+.I Entrydir
    2.64+means it represents a Venti directory.
    2.66+.I Entrydepthmask
    2.67+shifted by
    2.68+.I Entrydepthshift
    2.69+denotes the depth of the hash tree.
    2.71+.I Entryvarblocks
    2.72+denotes the block size is variable, overriding
    2.73+.IR dsize .
    2.75+.IB e .pack()
    2.76+Packs an
    2.77+.I Entry
    2.78+into bytes, ready for being stored to Venti.
    2.79+The result is always
    2.80+.I Entrysize
    2.81+bytes longs.
    2.83+.IB e .unpack(\fId\fP)
    2.84+Unpacks the
    2.85+.I Entry
    2.86+represented by
    2.87+.IR d ,
    2.88+which should be
    2.89+.I Entrysize
    2.90+bytes long.
    2.92+.B Root
    2.93+represents the root of a file hierarchy stored in Venti.
    2.95+.IB r .new(\fIname\fB,\ \fIrtype\fB,\ \fIscore\fB,\ \fIblocksize\fB,\ \fIprev\fB)
    2.96+Creates a new
    2.97+.I Root
    2.98+data structure.
    2.99+.I Name
   2.100+is a descriptive name for the file tree.
   2.101+.I Rtype
   2.102+denotes the type of the archive, currently only
   2.103+.I "vac"
   2.104+is known.  The maximum size in bytes of these two parameters is 128 bytes.
   2.105+.I Score
   2.106+is the score of the root directory
   2.107+.I Blocksize
   2.108+is the block block size used when writing the archive.
   2.109+.I Prev
   2.110+is the score of the previous version of the archive and may be
   2.111+.IR nil .
   2.113+.IB r .pack()
   2.114+Packs a
   2.115+.I Root
   2.116+into bytes, ready for being stored to Venti.
   2.117+The result is always
   2.118+.I Rootsize
   2.119+bytes longs.
   2.121+.IB r .unpack(\fId\fP)
   2.122+Unpacks the
   2.123+.I Root
   2.124+represented by
   2.125+.IR d ,
   2.126+which should be
   2.127+.I Rootsize
   2.128+bytes long.
   2.129 .SH SOURCE
   2.130 .B /appl/lib/venti.b
   2.131+.SH "SEE ALSO"
   2.132+.IR vac (2)
   2.134+.B Entry.unpack
   2.136+.B Root.unpack
   2.137+return nil and set the system error string when encountering badly formed data.
   2.138+.SH BUGS
   2.139+.B Root
   2.140+belongs in
   2.141+.IR vac (2).