summaryrefslogtreecommitdiff
path: root/static/inferno/man2/venti.2
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
commit97d5c458cfa039d857301e1ca7d5af3beb37131d (patch)
treeb460cd850d0537eb71806ba30358840377b27688 /static/inferno/man2/venti.2
parentb89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff)
build: Better Build System
Diffstat (limited to 'static/inferno/man2/venti.2')
-rw-r--r--static/inferno/man2/venti.2103
1 files changed, 103 insertions, 0 deletions
diff --git a/static/inferno/man2/venti.2 b/static/inferno/man2/venti.2
new file mode 100644
index 00000000..27150a86
--- /dev/null
+++ b/static/inferno/man2/venti.2
@@ -0,0 +1,103 @@
+.TH VENTI 2
+.SH NAME
+Venti \- access to Venti content-addressed filestore.
+.SH SYNOPSIS
+.EX
+include "venti.m";
+venti := load Venti Venti->PATH;
+Session: import venti;
+
+init: fn();
+
+Session: adt {
+ new: fn(fd: ref Sys->FD): ref Session;
+ read: fn(s: self ref Session, score: Venti->Score, etype: int, maxn: int): array of byte;
+ write: fn(s: self ref Session, etype: int, buf: array of byte): (int, Venti->Score);
+ sync: fn(s: self ref Session): int;
+};
+
+Score: adt {
+ a: array of byte;
+ eq: fn(a: self Score, b: Score): int;
+ text: fn(a: self Score): string;
+ parse: fn(s: string): (int, Score);
+ zero: fn(): Score;
+};
+
+.EE
+.SH DESCRIPTION
+.I Venti
+is a block storage server intended for archival applications.
+The
+.I Venti
+module provides low-level access to a Venti server.
+The module assumes that the physical connection
+to the server has already been established
+(for example, by
+.IR dial (2)).
+On a Venti server, a block is addressed by the SHA1 hash of
+the contents of that block, known as a
+.IR score ,
+and represented as a
+.B Score
+adt.
+Blocks are additionally tagged with a
+.IR type ,
+facilitating recovery in the event of corruption.
+A
+.B Session
+represents a session with a Venti server.
+.TP
+.IB s .new(\fIfd\fP)
+.B New
+performs the initial handshake with the Venti server,
+returning established
+.BR Session .
+.TP
+.IB s .read(\fIscore\fP,\ \fIetype\fP,\ \fImaxn\fP)
+.B Read
+tries to retrieve the block
+corresponding to
+.IR score ,
+and of type
+.IR etype .
+The block must be no longer than
+.I maxn
+bytes.
+.I Etype
+is conventionally one of the constants
+.BR Roottype ,
+.BR Dirtype ,
+.BR Datatype
+or
+.BR Pointertype [0-9],
+where the different
+.BR Pointertype s
+represent different depth levels within a Venti tree.
+.TP
+.IB s .write(\fIetype\fP,\ \fIbuf\fP)
+.B Write
+writes the data in
+.I buf
+to the Venti server.
+The block will be tagged with type
+.IR etype .
+It returns a tuple, say
+.RI ( ok ,\ score );
+on error,
+.I ok
+is -1, otherwise
+.I ok
+is 0 and
+.I score
+contains the Venti score for the block that has been written.
+.TP
+.IB s .sync()
+.B Sync
+tells the Venti server to make sure that all data is committed to
+active storage.
+.SH SOURCE
+.B /module/venti.m
+.br
+.B /appl/lib/venti.b
+.SH BUGS