mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
done
This commit is contained in:
parent
9f95eb6fd6
commit
3aec33fee9
20 changed files with 635 additions and 541 deletions
|
@ -311,6 +311,7 @@ the
|
||||||
variable in
|
variable in
|
||||||
.IR mk (1),
|
.IR mk (1),
|
||||||
.IR namespace (1),
|
.IR namespace (1),
|
||||||
|
.IR netfiles (1),
|
||||||
.IR page (1),
|
.IR page (1),
|
||||||
.IR psfonts (1),
|
.IR psfonts (1),
|
||||||
.IR rio (1),
|
.IR rio (1),
|
||||||
|
|
|
@ -65,11 +65,16 @@ Examine changes in block.c:
|
||||||
hist -d block.c
|
hist -d block.c
|
||||||
.EE
|
.EE
|
||||||
.SH FILES
|
.SH FILES
|
||||||
|
.TF /dump
|
||||||
|
.TP
|
||||||
.B /dump
|
.B /dump
|
||||||
|
by convention, root of dump file system
|
||||||
|
.PD
|
||||||
.SH SOURCE
|
.SH SOURCE
|
||||||
.B /home/am3/rsc/src/backup/cmd/history.c
|
.B /home/am3/rsc/src/backup/cmd/history.c
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.IR yesterday (1)
|
.IR yesterday (1),
|
||||||
|
.IR vbackup (8)
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
Should be called
|
Should be called
|
||||||
.IR history ,
|
.IR history ,
|
||||||
|
|
|
@ -1,263 +0,0 @@
|
||||||
.TH VBACKUP 8
|
|
||||||
.SH NAME
|
|
||||||
vbackup, vcat, vftp, vmount, vmount0, vnfs \-
|
|
||||||
back up Unix file systems to Venti
|
|
||||||
.SH SYNOPSIS
|
|
||||||
.B vbackup
|
|
||||||
[
|
|
||||||
.B -DVnv
|
|
||||||
]
|
|
||||||
[
|
|
||||||
.B -s
|
|
||||||
.I secs
|
|
||||||
]
|
|
||||||
[
|
|
||||||
.B -w
|
|
||||||
.I n
|
|
||||||
]
|
|
||||||
.I disk
|
|
||||||
[
|
|
||||||
.I score
|
|
||||||
]
|
|
||||||
.PP
|
|
||||||
.B vcat
|
|
||||||
[
|
|
||||||
.B -z
|
|
||||||
]
|
|
||||||
.I disk
|
|
||||||
|
|
|
||||||
.I score
|
|
||||||
.B >
|
|
||||||
.I disk
|
|
||||||
.PP
|
|
||||||
.B vftp
|
|
||||||
.I disk
|
|
||||||
|
|
|
||||||
.I score
|
|
||||||
.PP
|
|
||||||
.B vmount
|
|
||||||
[
|
|
||||||
.B -v
|
|
||||||
]
|
|
||||||
.I addr
|
|
||||||
.I mtpt
|
|
||||||
.PP
|
|
||||||
.B vmount0
|
|
||||||
[
|
|
||||||
.B -v
|
|
||||||
]
|
|
||||||
[
|
|
||||||
.B -h
|
|
||||||
.I handle
|
|
||||||
]
|
|
||||||
.I addr
|
|
||||||
.I mtpt
|
|
||||||
.PP
|
|
||||||
.B vnfs
|
|
||||||
[
|
|
||||||
.B -LLMRVr
|
|
||||||
]
|
|
||||||
[
|
|
||||||
.B -a
|
|
||||||
.I addr
|
|
||||||
]
|
|
||||||
[
|
|
||||||
.B -m
|
|
||||||
.I mntaddr
|
|
||||||
]
|
|
||||||
[
|
|
||||||
.B -b
|
|
||||||
.I blocksize
|
|
||||||
]
|
|
||||||
[
|
|
||||||
.B -c
|
|
||||||
.I cachesize
|
|
||||||
]
|
|
||||||
.I config
|
|
||||||
.SH DESCRIPTION
|
|
||||||
These programs back up and restore standard
|
|
||||||
Unix file system images stored in
|
|
||||||
.IR venti (8).
|
|
||||||
Images stored in
|
|
||||||
.I venti
|
|
||||||
are named by
|
|
||||||
.IR scores ,
|
|
||||||
which consist of a file system type followed
|
|
||||||
by a colon and forty hexadecimal digits, as in:
|
|
||||||
.IP
|
|
||||||
.EX
|
|
||||||
ffs:0123456789abcdef0123456789abcdef01234567
|
|
||||||
.EE
|
|
||||||
.PP
|
|
||||||
(The hexadecimal data is the SHA1 hash of the Venti
|
|
||||||
root block representing the file system image.)
|
|
||||||
.PP
|
|
||||||
These programs expect the environment variable
|
|
||||||
.B $venti
|
|
||||||
to be set to the network address of the Venti server to use
|
|
||||||
(for example,
|
|
||||||
.B yourhost
|
|
||||||
or
|
|
||||||
.BR tcp!yourhost!venti ).
|
|
||||||
.PP
|
|
||||||
.I Vbackup
|
|
||||||
copies the file system stored on
|
|
||||||
.I disk
|
|
||||||
to the Venti server and prints the
|
|
||||||
score for the newly-stored image.
|
|
||||||
The argument
|
|
||||||
.I disk
|
|
||||||
should be a disk or disk partition device
|
|
||||||
that would be appropriate to pass to
|
|
||||||
.IR mount (8).
|
|
||||||
.PP
|
|
||||||
The optional argument
|
|
||||||
.I score
|
|
||||||
is the score of a previous backup of the disk image.
|
|
||||||
If
|
|
||||||
.I score
|
|
||||||
is given,
|
|
||||||
.I vbackup
|
|
||||||
will not write to Venti any blocks that have not changed
|
|
||||||
since the previous backup.
|
|
||||||
This is only a speed optimization: since the blocks are already
|
|
||||||
stored on Venti they need not be sent to the Venti server again.
|
|
||||||
.PP
|
|
||||||
The options to
|
|
||||||
.I vbackup
|
|
||||||
are:
|
|
||||||
.TP
|
|
||||||
.B -D
|
|
||||||
.TP
|
|
||||||
.B -V
|
|
||||||
.TP
|
|
||||||
.B -n
|
|
||||||
.TP
|
|
||||||
.B -v
|
|
||||||
.TP
|
|
||||||
.B -w \fIn
|
|
||||||
.TP
|
|
||||||
.B -s \fIsecs
|
|
||||||
.PP
|
|
||||||
.I Vcat
|
|
||||||
writes the named disk image to standard output.
|
|
||||||
Unused file system blocks are printed zeroed regardless
|
|
||||||
of their actual content.
|
|
||||||
.PP
|
|
||||||
If the
|
|
||||||
.B -z
|
|
||||||
flag is given,
|
|
||||||
.I vcat
|
|
||||||
will attempt to seek over unused blocks instead of writing to them.
|
|
||||||
The
|
|
||||||
.B -z
|
|
||||||
flag should only be used when standard output is seekable
|
|
||||||
.RI ( i.e. ,
|
|
||||||
when it has been redirected to a file or disk).
|
|
||||||
.PP
|
|
||||||
.I Vftp
|
|
||||||
presents the
|
|
||||||
file system image named by
|
|
||||||
.I disk
|
|
||||||
or
|
|
||||||
.I score
|
|
||||||
in a shell-like
|
|
||||||
interactive session.
|
|
||||||
Type
|
|
||||||
.B help
|
|
||||||
at the
|
|
||||||
.B vftp>
|
|
||||||
prompt for details.
|
|
||||||
.PP
|
|
||||||
.I Vmount
|
|
||||||
mounts the NFS service at the network connection
|
|
||||||
.I address
|
|
||||||
onto
|
|
||||||
.IR mountpoint .
|
|
||||||
On most operating systems,
|
|
||||||
.I vmount
|
|
||||||
must be run by the user
|
|
||||||
.BR root .
|
|
||||||
.PP
|
|
||||||
.I Vmount0
|
|
||||||
is a simple C program that
|
|
||||||
.I vmount
|
|
||||||
uses if
|
|
||||||
.IR mount (8)
|
|
||||||
does not suffice.
|
|
||||||
.PP
|
|
||||||
.I Vnfs
|
|
||||||
serves, using the
|
|
||||||
NFS version 3 protocol,
|
|
||||||
one or more disk images in a synthetic tree defined
|
|
||||||
by the configuration file
|
|
||||||
.IR config .
|
|
||||||
.I Vnfs
|
|
||||||
announces NFS service at
|
|
||||||
.IR addr
|
|
||||||
(default
|
|
||||||
.BR udp!*!nfs )
|
|
||||||
and NFS mount service at
|
|
||||||
.IR mntaddr
|
|
||||||
(default
|
|
||||||
.BR udp!*!\fI999 ),
|
|
||||||
registering both with the port mapper.
|
|
||||||
If no port mapper is found running (on port 111),
|
|
||||||
.I vnfs
|
|
||||||
starts its own port mapper.
|
|
||||||
The options are:
|
|
||||||
.TP
|
|
||||||
.B -r
|
|
||||||
Reply to all NFS requests with RPC rejections.
|
|
||||||
.TP
|
|
||||||
.B -M
|
|
||||||
Do not announce an NFS mount service.
|
|
||||||
.TP
|
|
||||||
.B -P
|
|
||||||
Do not register service with the port mapper.
|
|
||||||
.TP
|
|
||||||
.B -a
|
|
||||||
|
|
||||||
|
|
||||||
.SH EXAMPLES
|
|
||||||
.PP
|
|
||||||
Back up the file system stored on
|
|
||||||
.BR /dev/da0s1a :
|
|
||||||
.IP
|
|
||||||
.EX
|
|
||||||
% vbackup /dev/da0s1a
|
|
||||||
ffs:0123456789abcdef0123456789abcdef01234567
|
|
||||||
%
|
|
||||||
.EE
|
|
||||||
.PP
|
|
||||||
Serve that backup and a few others in a tree reminiscent
|
|
||||||
of Plan 9's dump file system, but hide each day's contents of
|
|
||||||
.B /tmp :
|
|
||||||
.IP
|
|
||||||
.EX
|
|
||||||
% cat config
|
|
||||||
mount /2005/0510 ffs:0123456789abcdef\fI...\fP
|
|
||||||
mount /2005/0510/home ffs:0123456789abcdef\fI...\fP
|
|
||||||
mount /2005/0510 ffs:0123456789abcdef\fI...\fP
|
|
||||||
mount /2005/0510/home ffs:0123456789abcdef\fI...\fP
|
|
||||||
hide /*/*/tmp
|
|
||||||
% vnfs -m -b 16k -c 1k config
|
|
||||||
%
|
|
||||||
.EE
|
|
||||||
.PP
|
|
||||||
Mount the backups on a client machine using
|
|
||||||
.IR vmount :
|
|
||||||
.IP
|
|
||||||
.EX
|
|
||||||
# vmount udp!yourserver!nfs /dump
|
|
||||||
# ls /dump
|
|
||||||
2005
|
|
||||||
#
|
|
||||||
.EE
|
|
||||||
.PP
|
|
||||||
Mount the backups using the standard NFS mount program:
|
|
||||||
.IP
|
|
||||||
.EX
|
|
||||||
# mount -t nfs -o soft,intr,ro,nfsv3,rsize=8192,timeo=100 \
|
|
||||||
-o nfsvers=3,nolock,noatime,nodev,nosuid \
|
|
||||||
.EE
|
|
|
@ -85,7 +85,7 @@ If the
|
||||||
.B -z
|
.B -z
|
||||||
option is given,
|
option is given,
|
||||||
.I write
|
.I write
|
||||||
truncates the block before writing it to the server.
|
zero truncates the block before writing it to the server.
|
||||||
.PP
|
.PP
|
||||||
.I Copy
|
.I Copy
|
||||||
expects
|
expects
|
||||||
|
@ -114,14 +114,15 @@ and
|
||||||
.B -r
|
.B -r
|
||||||
option control
|
option control
|
||||||
.IR copy 's
|
.IR copy 's
|
||||||
behavior upon encountering errors while reading
|
reaction to errors reading
|
||||||
from srchost.
|
from
|
||||||
|
.IR srchost .
|
||||||
.I Copy
|
.I Copy
|
||||||
always prints information to standard error
|
always prints information to standard error
|
||||||
about each read error.
|
about each read error.
|
||||||
By default,
|
By default,
|
||||||
.I copy
|
.I copy
|
||||||
immediately exits after printing the first error.
|
exits after printing the first error.
|
||||||
If the
|
If the
|
||||||
.B -i
|
.B -i
|
||||||
option is given, read errors are ignored.
|
option is given, read errors are ignored.
|
||||||
|
@ -138,12 +139,11 @@ It writes the new root score to standard output.
|
||||||
.B \*9/src/cmd/venti/cmd
|
.B \*9/src/cmd/venti/cmd
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.IR vac (1),
|
.IR vac (1),
|
||||||
.IR vbackup (1),
|
|
||||||
.IR venti (3),
|
.IR venti (3),
|
||||||
.IR vacfs (4),
|
.IR vacfs (4),
|
||||||
.IR vnfs (4),
|
|
||||||
.IR venti (7),
|
.IR venti (7),
|
||||||
|
.IR vbackup (8),
|
||||||
.IR venti (8)
|
.IR venti (8)
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
There should be programs to read and write
|
There should be programs to read and write
|
||||||
streams and directories.
|
venti files and directories.
|
||||||
|
|
|
@ -84,16 +84,15 @@ Restore your profile from yesterday:
|
||||||
yesterday -c ~/.profile
|
yesterday -c ~/.profile
|
||||||
.EE
|
.EE
|
||||||
.SH FILES
|
.SH FILES
|
||||||
|
.TF /dump
|
||||||
.B /dump
|
.B /dump
|
||||||
|
by convention, root of the dump file system
|
||||||
|
.PD
|
||||||
.SH SOURCE
|
.SH SOURCE
|
||||||
.B /usr/local/bin/yesterday
|
.B /usr/local/bin/yesterday
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.IR diff (1),
|
.IR diff (1),
|
||||||
.IR hist (1)
|
.IR hist (1),
|
||||||
|
.IR vbackup (8)
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
Backups are only available on
|
|
||||||
.B amsterdam
|
|
||||||
and
|
|
||||||
.BR toil .
|
|
||||||
.PP
|
|
||||||
It's hard to use this command without singing.
|
It's hard to use this command without singing.
|
||||||
|
|
|
@ -24,6 +24,8 @@ vtlocaltoglobal \- Venti block cache
|
||||||
#include <venti.h>
|
#include <venti.h>
|
||||||
.ta +\w'\fLxxxx 'u
|
.ta +\w'\fLxxxx 'u
|
||||||
.PP
|
.PP
|
||||||
|
.ft L
|
||||||
|
.nf
|
||||||
typedef struct VtBlock
|
typedef struct VtBlock
|
||||||
{
|
{
|
||||||
uchar *data;
|
uchar *data;
|
||||||
|
@ -35,16 +37,13 @@ typedef struct VtBlock
|
||||||
.ta +\w'\fLVtBlock* 'u +\w'\fLxxxxxxxx'u
|
.ta +\w'\fLVtBlock* 'u +\w'\fLxxxxxxxx'u
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
VtCache* vtcachealloc(VtConn *z, int blocksize, ulong nblocks, int mode);
|
VtCache* vtcachealloc(VtConn *z, int blocksize, ulong nblocks);
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
void vtcachefree(VtCache *c);
|
void vtcachefree(VtCache *c);
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
u32int vtcacheblocksize(VtCache *c);
|
u32int vtcacheblocksize(VtCache *c);
|
||||||
.br
|
|
||||||
.B
|
|
||||||
int (*write)(VtConn*, uchar[VtScoreSize], uint, uchar*, int));
|
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
u32int vtglobaltolocal(uchar score[VtScoreSize])
|
u32int vtglobaltolocal(uchar score[VtScoreSize])
|
||||||
|
@ -72,6 +71,9 @@ int vtblockwrite(VtBlock *b);
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
void vtcachesetwrite(VtCache *c,
|
void vtcachesetwrite(VtCache *c,
|
||||||
|
.br
|
||||||
|
.B
|
||||||
|
int (*write)(VtConn*, uchar[VtScoreSize], uint, uchar*, int));
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
VtBlock* vtblockcopy(VtBlock *b);
|
VtBlock* vtblockcopy(VtBlock *b);
|
||||||
|
@ -83,6 +85,37 @@ These functions provide access to a simple in-memory
|
||||||
cache of blocks already stored on a Venti server
|
cache of blocks already stored on a Venti server
|
||||||
and blocks that will eventually be stored on a Venti server.
|
and blocks that will eventually be stored on a Venti server.
|
||||||
.PP
|
.PP
|
||||||
|
A
|
||||||
|
.B VtBlock
|
||||||
|
represents a venti data block.
|
||||||
|
Blocks stored on a venti server,
|
||||||
|
called
|
||||||
|
.IR "global blocks" ,
|
||||||
|
are named by the SHA1 hash of their contents.
|
||||||
|
This hash is recorded as the block's
|
||||||
|
.IR score .
|
||||||
|
Such blocks are immutable.
|
||||||
|
The cache also stores mutable blocks that have not yet been
|
||||||
|
written to a venti server. These blocks are called
|
||||||
|
.IR "local blocks" ,
|
||||||
|
and have special scores that are 16 zero bytes
|
||||||
|
followed by a 4-byte big-endian
|
||||||
|
.IR address .
|
||||||
|
The address is an index into the internal set of cache blocks.
|
||||||
|
.PP
|
||||||
|
The user-visible contents of a
|
||||||
|
.B VtBlock
|
||||||
|
are
|
||||||
|
.BR data ,
|
||||||
|
a pointer to the data;
|
||||||
|
.BR type ,
|
||||||
|
the venti block type;
|
||||||
|
.BR score ,
|
||||||
|
the block's score;
|
||||||
|
and
|
||||||
|
.BR addr ,
|
||||||
|
the block's cache address.
|
||||||
|
.PP
|
||||||
.I Vtcachealloc
|
.I Vtcachealloc
|
||||||
allocates a new cache using the client connection
|
allocates a new cache using the client connection
|
||||||
.I z
|
.I z
|
||||||
|
@ -99,8 +132,22 @@ of maximum block size
|
||||||
frees a cache and all the associated blocks.
|
frees a cache and all the associated blocks.
|
||||||
.PP
|
.PP
|
||||||
.I Vtcacheblocksize
|
.I Vtcacheblocksize
|
||||||
|
returns the cache's maximum block size.
|
||||||
.PP
|
.PP
|
||||||
XXX global vs local blocks
|
.I Vtglobaltolocal
|
||||||
|
returns the local address corresponding to the given
|
||||||
|
local
|
||||||
|
.IR score .
|
||||||
|
If passed a global score,
|
||||||
|
.I vtglobaltolocal
|
||||||
|
returns the special constant
|
||||||
|
.B NilBlock
|
||||||
|
.RB ( ~0 ).
|
||||||
|
.I Vtlocaltoglobal
|
||||||
|
is the opposite, setting
|
||||||
|
.I score
|
||||||
|
to the local score for the cache address
|
||||||
|
.IR local .
|
||||||
.PP
|
.PP
|
||||||
.I Vtcacheallocblock
|
.I Vtcacheallocblock
|
||||||
allocates a new local block with the given
|
allocates a new local block with the given
|
||||||
|
@ -124,8 +171,9 @@ from the cache, consulting the Venti server
|
||||||
if necessary.
|
if necessary.
|
||||||
If passed a local score,
|
If passed a local score,
|
||||||
.I vtcacheglobal
|
.I vtcacheglobal
|
||||||
behaves as
|
invokes
|
||||||
.IR vtcachelocal .
|
.I vtcachelocal
|
||||||
|
appropriately.
|
||||||
.PP
|
.PP
|
||||||
The block references returned by
|
The block references returned by
|
||||||
.IR vtcacheallocblock ,
|
.IR vtcacheallocblock ,
|
||||||
|
@ -191,8 +239,8 @@ or, more commonly, that cache blocks are being leaked.
|
||||||
.SH SOURCE
|
.SH SOURCE
|
||||||
.B \*9/src/libventi
|
.B \*9/src/libventi
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.IR venti (1),
|
|
||||||
.IR venti (3),
|
.IR venti (3),
|
||||||
.IR venti-client (3),
|
.IR venti-client (3),
|
||||||
.IR venti-conn (3),
|
.IR venti-conn (3),
|
||||||
.IR venti-file (3)
|
.IR venti-file (3),
|
||||||
|
.IR venti (7)
|
||||||
|
|
|
@ -8,7 +8,7 @@ vtconnect, vthello, vtread, vtwrite, vtreadpacket, vtwritepacket, vtsync, vtping
|
||||||
#include <libc.h>
|
#include <libc.h>
|
||||||
.br
|
.br
|
||||||
#include <venti.h>
|
#include <venti.h>
|
||||||
.ta +\w'\fLextern int 'u +\w'\fLxxxxxxxx'u
|
.ta +\w'\fLPacket* 'u +\w'\fLxxxxxxxx'u
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
Packet* vtrpc(VtConn *z, Packet *p)
|
Packet* vtrpc(VtConn *z, Packet *p)
|
||||||
|
@ -50,7 +50,7 @@ int vtsync(VtConn *z)
|
||||||
int vtping(VtConn *z)
|
int vtping(VtConn *z)
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
extern int ventidoublechecksha1; /* default 1 */
|
extern int ventidoublechecksha1; /* default 1 */
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
These routines execute the client side of the
|
These routines execute the client side of the
|
||||||
.IR venti (7)
|
.IR venti (7)
|
||||||
|
@ -73,10 +73,8 @@ is typically called only indirectly, via the functions below.
|
||||||
.I Vthello
|
.I Vthello
|
||||||
executes a
|
executes a
|
||||||
.B hello
|
.B hello
|
||||||
transaction
|
transaction, setting
|
||||||
(see
|
.IB z ->sid
|
||||||
.IR venti (7)), setting
|
|
||||||
.IB z -> sid
|
|
||||||
to the name used by the server.
|
to the name used by the server.
|
||||||
.I Vthello
|
.I Vthello
|
||||||
is typically called only indirectly, via
|
is typically called only indirectly, via
|
||||||
|
@ -103,11 +101,11 @@ reads the block with the given
|
||||||
and
|
and
|
||||||
.I type
|
.I type
|
||||||
from the server,
|
from the server,
|
||||||
writes the returned data
|
stores the returned data
|
||||||
to
|
in memory at
|
||||||
.IR buf ,
|
.IR buf ,
|
||||||
and returns the number of bytes retrieved.
|
and returns the number of bytes read.
|
||||||
If the stored block has size larger than
|
If the server's block has size larger than
|
||||||
.IR n ,
|
.IR n ,
|
||||||
.I vtread
|
.I vtread
|
||||||
does not modify
|
does not modify
|
||||||
|
@ -120,7 +118,7 @@ writes the
|
||||||
.I n
|
.I n
|
||||||
bytes in
|
bytes in
|
||||||
.I buf
|
.I buf
|
||||||
with type
|
as a block of the given
|
||||||
.IR type ,
|
.IR type ,
|
||||||
setting
|
setting
|
||||||
.IR score .
|
.IR score .
|
||||||
|
@ -177,7 +175,6 @@ as described in
|
||||||
.SH SOURCE
|
.SH SOURCE
|
||||||
.B \*9/src/libventi
|
.B \*9/src/libventi
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.IR venti (1),
|
|
||||||
.IR venti (3),
|
.IR venti (3),
|
||||||
.IR venti-conn (3),
|
.IR venti-conn (3),
|
||||||
.IR venti-packet (3),
|
.IR venti-packet (3),
|
||||||
|
@ -190,5 +187,4 @@ return nil on error.
|
||||||
The other routines return \-1 on error.
|
The other routines return \-1 on error.
|
||||||
.PP
|
.PP
|
||||||
.I Vtwrite
|
.I Vtwrite
|
||||||
returns 0 on success,
|
returns 0 on success: there are no partial writes.
|
||||||
meaning it wrote the entire block.
|
|
||||||
|
|
|
@ -61,6 +61,18 @@ A
|
||||||
.B VtConn
|
.B VtConn
|
||||||
structure represents a connection to a Venti server
|
structure represents a connection to a Venti server
|
||||||
(when used by a client) or to a client (when used by a server).
|
(when used by a client) or to a client (when used by a server).
|
||||||
|
It contains the following user-visible fields:
|
||||||
|
.BR debug ,
|
||||||
|
a flag enabling debugging prints;
|
||||||
|
.BR version ,
|
||||||
|
the protocol version in use;
|
||||||
|
.BR uid ,
|
||||||
|
the (unverified) name of the client;
|
||||||
|
.BR sid ,
|
||||||
|
the (unverified) name of the server;
|
||||||
|
and
|
||||||
|
.BR addr ,
|
||||||
|
the network address of the remote side.
|
||||||
.PP
|
.PP
|
||||||
.I Vtconn
|
.I Vtconn
|
||||||
initializes a new connection structure using file descriptors
|
initializes a new connection structure using file descriptors
|
||||||
|
@ -81,7 +93,7 @@ exchanges version information with the remote side
|
||||||
as described in
|
as described in
|
||||||
.IR venti (7).
|
.IR venti (7).
|
||||||
The negotiated version is stored in
|
The negotiated version is stored in
|
||||||
.IB z -> version \fR.
|
.IB z ->version \fR.
|
||||||
.PP
|
.PP
|
||||||
.I Vtsend
|
.I Vtsend
|
||||||
writes a packet
|
writes a packet
|
||||||
|
@ -146,7 +158,7 @@ must be the connection structure
|
||||||
.I Vtdebug
|
.I Vtdebug
|
||||||
prints the formatted message to standard error
|
prints the formatted message to standard error
|
||||||
when
|
when
|
||||||
.IB z -> debug
|
.IB z ->debug
|
||||||
is set. Otherwise it is a no-op.
|
is set. Otherwise it is a no-op.
|
||||||
.PP
|
.PP
|
||||||
.I Vthangup
|
.I Vthangup
|
||||||
|
|
|
@ -14,7 +14,7 @@ vtputstring,
|
||||||
vtrootpack,
|
vtrootpack,
|
||||||
vtrootunpack,
|
vtrootunpack,
|
||||||
vtparsescore,
|
vtparsescore,
|
||||||
vtscorefmt \- Venti external data representation
|
vtscorefmt \- venti data formats
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.PP
|
.PP
|
||||||
.ft L
|
.ft L
|
||||||
|
@ -31,7 +31,6 @@ enum
|
||||||
{
|
{
|
||||||
VtEntrySize = 40,
|
VtEntrySize = 40,
|
||||||
VtRootSize = 300,
|
VtRootSize = 300,
|
||||||
VtRootVersion = 2,
|
|
||||||
VtScoreSize = 20,
|
VtScoreSize = 20,
|
||||||
};
|
};
|
||||||
.PP
|
.PP
|
||||||
|
@ -39,9 +38,9 @@ enum
|
||||||
.nf
|
.nf
|
||||||
typedef struct VtEntry
|
typedef struct VtEntry
|
||||||
{
|
{
|
||||||
ulong gen; /* generation number */
|
ulong gen; /* generation number */
|
||||||
ushort psize; /* pointer block size */
|
ushort psize; /* pointer block size */
|
||||||
ushort dsize; /* data block size */
|
ushort dsize; /* data block size */
|
||||||
uchar type;
|
uchar type;
|
||||||
uchar flags;
|
uchar flags;
|
||||||
uvlong size;
|
uvlong size;
|
||||||
|
@ -54,9 +53,9 @@ typedef struct VtRoot
|
||||||
{
|
{
|
||||||
char name[128];
|
char name[128];
|
||||||
char type[128];
|
char type[128];
|
||||||
uchar score[VtScoreSize]; /* to a Dir block */
|
uchar score[VtScoreSize]; /* to a Dir block */
|
||||||
ushort blocksize; /* maximum block size */
|
ushort blocksize; /* maximum block size */
|
||||||
uchar prev[VtScoreSize]; /* previous root block */
|
uchar prev[VtScoreSize]; /* previous root block */
|
||||||
} VtRoot;
|
} VtRoot;
|
||||||
.ta +\w'\fLPacket* 'u
|
.ta +\w'\fLPacket* 'u
|
||||||
.PP
|
.PP
|
||||||
|
@ -110,7 +109,7 @@ converts a
|
||||||
.B VtEntry
|
.B VtEntry
|
||||||
structure describing a Venti file
|
structure describing a Venti file
|
||||||
(see
|
(see
|
||||||
.IR venti (1))
|
.IR venti (7))
|
||||||
into a 40-byte
|
into a 40-byte
|
||||||
.RB ( VtEntrySize )
|
.RB ( VtEntrySize )
|
||||||
structure at
|
structure at
|
||||||
|
@ -150,7 +149,7 @@ frees the strings
|
||||||
.IB f ->uid \fR,
|
.IB f ->uid \fR,
|
||||||
.IB f ->sid \fR,
|
.IB f ->sid \fR,
|
||||||
the buffers
|
the buffers
|
||||||
.I f ->crypto
|
.IB f ->crypto
|
||||||
and
|
and
|
||||||
.IB f ->codec \fR,
|
.IB f ->codec \fR,
|
||||||
and the packet
|
and the packet
|
||||||
|
@ -159,11 +158,11 @@ and the packet
|
||||||
The block type enumeration defined in
|
The block type enumeration defined in
|
||||||
.B <venti.h>
|
.B <venti.h>
|
||||||
(presented in
|
(presented in
|
||||||
.IR venti (1))
|
.IR venti (7))
|
||||||
differs from the one used on disk and in the network
|
differs from the one used on disk and in the network
|
||||||
protocol.
|
protocol.
|
||||||
The disk and network representation uses different
|
The disk and network representation uses different
|
||||||
constants does not distinguish between
|
constants and does not distinguish between
|
||||||
.BI VtDataType+ n
|
.BI VtDataType+ n
|
||||||
and
|
and
|
||||||
.BI VtDirType+ n
|
.BI VtDirType+ n
|
||||||
|
@ -173,7 +172,10 @@ converts a
|
||||||
.B <venti.h>
|
.B <venti.h>
|
||||||
enumeration value to the disk value;
|
enumeration value to the disk value;
|
||||||
.I vtfromdisktype
|
.I vtfromdisktype
|
||||||
converts a disk value to the enumeration value.
|
converts a disk value to the enumeration value,
|
||||||
|
always using the
|
||||||
|
.B VtDataType
|
||||||
|
pointers.
|
||||||
The
|
The
|
||||||
.B VtFcall
|
.B VtFcall
|
||||||
field
|
field
|
||||||
|
|
|
@ -1,29 +1,29 @@
|
||||||
.TH VENTI-FILE 3
|
.TH VENTI-FILE 3
|
||||||
.SH NAME
|
.SH NAME
|
||||||
VtFile,
|
VtFile,
|
||||||
vtfileopenroot,
|
|
||||||
vtfilecreateroot,
|
|
||||||
vtfileopen,
|
|
||||||
vtfilecreate,
|
|
||||||
vtfileblock,
|
vtfileblock,
|
||||||
vtfileread,
|
|
||||||
vtfilewrite,
|
|
||||||
vtfileflush,
|
|
||||||
vtfileincref,
|
|
||||||
vtfileclose,
|
|
||||||
vtfilegetentry,
|
|
||||||
vtfilesetentry,
|
|
||||||
vtfileblockscore,
|
vtfileblockscore,
|
||||||
|
vtfileclose,
|
||||||
|
vtfilecreate,
|
||||||
|
vtfilecreateroot,
|
||||||
|
vtfileflush,
|
||||||
|
vtfileflushbefore,
|
||||||
vtfilegetdirsize,
|
vtfilegetdirsize,
|
||||||
vtfilesetdirsize,
|
vtfilegetentry,
|
||||||
vtfileunlock,
|
vtfilegetsize,
|
||||||
|
vtfileincref,
|
||||||
vtfilelock,
|
vtfilelock,
|
||||||
vtfilelock2,
|
vtfilelock2,
|
||||||
vtfileflushbefore,
|
vtfileopen,
|
||||||
vtfiletruncate,
|
vtfileopenroot,
|
||||||
vtfilegetsize,
|
vtfileread,
|
||||||
|
vtfileremove,
|
||||||
|
vtfilesetdirsize,
|
||||||
|
vtfilesetentry,
|
||||||
vtfilesetsize,
|
vtfilesetsize,
|
||||||
vtfileremove \- Venti files
|
vtfiletruncate,
|
||||||
|
vtfileunlock,
|
||||||
|
vtfilewrite \- Venti files
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.ta +\w'\fLVtBlock* 'u
|
.ta +\w'\fLVtBlock* 'u
|
||||||
.PP
|
.PP
|
||||||
|
@ -85,7 +85,8 @@ int vtfilegetentry(VtFile *f, VtEntry *e);
|
||||||
int vtfilesetentry(VtFile *f, VtEntry *e);
|
int vtfilesetentry(VtFile *f, VtEntry *e);
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
int vtfileblockscore(VtFile *f, u32int n, uchar score[VtScoreSize]);
|
int vtfileblockscore(VtFile *f, u32int n,
|
||||||
|
uchar score[VtScoreSize]);
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
int vtfilelock(VtFile *f, int mode);
|
int vtfilelock(VtFile *f, int mode);
|
||||||
|
@ -98,11 +99,11 @@ void vtfileunlock(VtFile *f);
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
These routines provide a simple interface to create and
|
These routines provide a simple interface to create and
|
||||||
manipulate Venti file trees (see
|
manipulate Venti file trees (see
|
||||||
.IR venti (1)).
|
.IR venti (7)).
|
||||||
.PP
|
.PP
|
||||||
.I Vtfilecreateroot
|
.I Vtfilecreateroot
|
||||||
creates a new Venti file.
|
creates a new Venti file.
|
||||||
.I Btype
|
.I Type
|
||||||
must be either
|
must be either
|
||||||
.B VtDataType
|
.B VtDataType
|
||||||
or
|
or
|
||||||
|
@ -111,7 +112,7 @@ specifying a data or directory file.
|
||||||
.I Dsize
|
.I Dsize
|
||||||
is the block size to use for leaf (data or directory) blocks in the hash tree;
|
is the block size to use for leaf (data or directory) blocks in the hash tree;
|
||||||
.I psize
|
.I psize
|
||||||
is the block size to use for intermediate (pointer) blocks.
|
is the block size to use for internal (pointer) blocks.
|
||||||
.PP
|
.PP
|
||||||
.I Vtfileopenroot
|
.I Vtfileopenroot
|
||||||
opens an existing Venti file described by
|
opens an existing Venti file described by
|
||||||
|
@ -124,19 +125,19 @@ entry in the directory
|
||||||
.IR f .
|
.IR f .
|
||||||
.I Mode
|
.I Mode
|
||||||
should be one of
|
should be one of
|
||||||
.IR VtOREAD ,
|
.BR VtOREAD ,
|
||||||
.IR VtOWRITE ,
|
.BR VtOWRITE ,
|
||||||
or
|
or
|
||||||
.IR VtORDWR ,
|
.BR VtORDWR ,
|
||||||
indicating how the returned file is to be used.
|
indicating how the returned file is to be used.
|
||||||
The
|
The
|
||||||
.IR VtOWRITE
|
.BR VtOWRITE
|
||||||
and
|
and
|
||||||
.IR VtORDWR
|
.BR VtORDWR
|
||||||
modes can only be used if
|
modes can only be used if
|
||||||
.IR f
|
.IR f
|
||||||
is open with mode
|
is open with mode
|
||||||
.IR VtORDWR .
|
.BR VtORDWR .
|
||||||
.PP
|
.PP
|
||||||
.I Vtfilecreate
|
.I Vtfilecreate
|
||||||
creates a new file in the directory
|
creates a new file in the directory
|
||||||
|
@ -239,7 +240,7 @@ Loops that
|
||||||
.I vtfilewrite
|
.I vtfilewrite
|
||||||
should call
|
should call
|
||||||
.I vtfileflushbefore
|
.I vtfileflushbefore
|
||||||
regularly to avoid filling the block cache with dirty blocks.
|
regularly to avoid filling the block cache with unwritten blocks.
|
||||||
.PP
|
.PP
|
||||||
.I Vtfiletruncate
|
.I Vtfiletruncate
|
||||||
changes the file
|
changes the file
|
||||||
|
@ -283,7 +284,7 @@ to be
|
||||||
returns in
|
returns in
|
||||||
.I score
|
.I score
|
||||||
the score of the
|
the score of the
|
||||||
.I n th
|
.IR n th
|
||||||
block in the file
|
block in the file
|
||||||
.IR f .
|
.IR f .
|
||||||
.PP
|
.PP
|
||||||
|
@ -318,7 +319,7 @@ in the same directory block.
|
||||||
.SH SOURCE
|
.SH SOURCE
|
||||||
.B \*9/src/libventi/file.c
|
.B \*9/src/libventi/file.c
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.IR venti (1),
|
|
||||||
.IR venti-cache (3),
|
.IR venti-cache (3),
|
||||||
.IR venti-conn (3),
|
.IR venti-conn (3),
|
||||||
.IR venti-client (3)
|
.IR venti-client (3),
|
||||||
|
.IR venti (7)
|
||||||
|
|
|
@ -50,17 +50,19 @@ extern char *VtServerLog; /* "libventi/server" */
|
||||||
These routines provide an in-memory circular log
|
These routines provide an in-memory circular log
|
||||||
structure used by the Venti library and the Venti server
|
structure used by the Venti library and the Venti server
|
||||||
to record events for debugging purposes.
|
to record events for debugging purposes.
|
||||||
The logs have textual names represented as UTF strings.
|
The logs are named by UTF strings.
|
||||||
.PP
|
.PP
|
||||||
.I Vtlogopen
|
.I Vtlogopen
|
||||||
returns a reference to the log named
|
returns a reference to the log with the given
|
||||||
.I name .
|
.I name .
|
||||||
If a log with that name does not exist and
|
If a log with that name does not exist and
|
||||||
.I size
|
.I size
|
||||||
is non-zero, a new log capable of holding at
|
is non-zero,
|
||||||
|
.I vtlogopen
|
||||||
|
creates a new log capable of holding at
|
||||||
least
|
least
|
||||||
.I size
|
.I size
|
||||||
bytes is allocated and returned.
|
bytes and returns it.
|
||||||
.I Vtlogclose
|
.I Vtlogclose
|
||||||
releases the reference returned by
|
releases the reference returned by
|
||||||
.IR vtlogopen .
|
.IR vtlogopen .
|
||||||
|
@ -126,8 +128,9 @@ and
|
||||||
writes debugging information to the log named
|
writes debugging information to the log named
|
||||||
.IR VtServerLog ,
|
.IR VtServerLog ,
|
||||||
which defaults to the string
|
which defaults to the string
|
||||||
.LR libventi/server .
|
.RB ` libventi/server '.
|
||||||
.SH SOURCE
|
.SH SOURCE
|
||||||
.B \*9/src/libventi
|
.B \*9/src/libventi
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.IR venti (3)
|
.IR venti (3),
|
||||||
|
.IR venti (8)
|
||||||
|
|
|
@ -39,10 +39,9 @@ On failure, they print an error message and call
|
||||||
They do not return.
|
They do not return.
|
||||||
.PP
|
.PP
|
||||||
.I Vtbrk
|
.I Vtbrk
|
||||||
returns a pointer to a new block of at least
|
returns a pointer to a new, permanently allocated block of at least
|
||||||
.I size
|
.I size
|
||||||
bytes.
|
bytes.
|
||||||
The block cannot be freed.
|
|
||||||
.PP
|
.PP
|
||||||
.IR Vtmalloc ,
|
.IR Vtmalloc ,
|
||||||
.IR vtrealloc ,
|
.IR vtrealloc ,
|
||||||
|
|
|
@ -1,11 +1,26 @@
|
||||||
.TH VENTI-PACKET 3
|
.TH VENTI-PACKET 3
|
||||||
.SH NAME
|
.SH NAME
|
||||||
Packet, packetalloc, packetfree, packetforeign, packetdup,
|
Packet,
|
||||||
packetsplit, packetconsume, packettrim, packetheader,
|
packetalloc,
|
||||||
packettrailer, packetprefix, packetappend, packetconcat,
|
packetappend,
|
||||||
packetpeek, packetcopy, packetfragments,
|
packetasize,
|
||||||
packetsize, packetasize, packetcompact, packetcmp,
|
packetcmp,
|
||||||
packetstats, packetsha1 \- zero-copy network buffers
|
packetconcat,
|
||||||
|
packetconsume,
|
||||||
|
packetcopy,
|
||||||
|
packetdup,
|
||||||
|
packetforeign,
|
||||||
|
packetfragments,
|
||||||
|
packetfree,
|
||||||
|
packetheader,
|
||||||
|
packetpeek,
|
||||||
|
packetprefix,
|
||||||
|
packetsha1,
|
||||||
|
packetsize,
|
||||||
|
packetsplit,
|
||||||
|
packetstats,
|
||||||
|
packettrailer,
|
||||||
|
packettrim \- zero-copy network buffers
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.ft L
|
.ft L
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
|
@ -21,72 +36,73 @@ packetstats, packetsha1 \- zero-copy network buffers
|
||||||
Packet* packetalloc(void);
|
Packet* packetalloc(void);
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
void packetfree(Packet *p)
|
|
||||||
.PP
|
|
||||||
.B
|
|
||||||
Packet* packetforeign(uchar *buf, int n,
|
|
||||||
.br
|
|
||||||
.B
|
|
||||||
void (*free)(void *a), void *a)
|
|
||||||
.PP
|
|
||||||
.B
|
|
||||||
Packet* packetdup(Packet *p, int offset, int n)
|
|
||||||
.PP
|
|
||||||
.B
|
|
||||||
Packet* packetsplit(Packet *p, int n)
|
|
||||||
.PP
|
|
||||||
.B
|
|
||||||
int packetconsume(Packet *p, uchar *buf, int n)
|
|
||||||
.PP
|
|
||||||
.B
|
|
||||||
int packettrim(Packet *p, int offset, int n)
|
|
||||||
.PP
|
|
||||||
.B
|
|
||||||
uchar* packetheader(Packet *p, int n)
|
|
||||||
.PP
|
|
||||||
.B
|
|
||||||
uchar* packettrailer(Packet *p, int n)
|
|
||||||
.PP
|
|
||||||
.B
|
|
||||||
void packetprefix(Packet *p, uchar *buf, int n)
|
|
||||||
.PP
|
|
||||||
.B
|
|
||||||
void packetappend(Packet *p, uchar *buf, int n)
|
void packetappend(Packet *p, uchar *buf, int n)
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
void packetconcat(Packet *p, Packet *q)
|
|
||||||
.PP
|
|
||||||
.B
|
|
||||||
uchar* packetpeek(Packet *p, uchar *buf, int offset, int n)
|
|
||||||
.PP
|
|
||||||
.B
|
|
||||||
int packetcopy(Packet *p, uchar *buf, int offset, int n)
|
|
||||||
.PP
|
|
||||||
.B
|
|
||||||
int packetfragments(Packet *p, IOchunk *io, int nio,
|
|
||||||
.br
|
|
||||||
.B
|
|
||||||
int offset)
|
|
||||||
.PP
|
|
||||||
.B
|
|
||||||
uint packetsize(Packet *p)
|
|
||||||
.PP
|
|
||||||
.B
|
|
||||||
uint packetasize(Packet *p)
|
uint packetasize(Packet *p)
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
int packetcmp(Packet *p, Packet *q)
|
int packetcmp(Packet *p, Packet *q)
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
void packetstats(void)
|
void packetconcat(Packet *p, Packet *q)
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
|
int packetconsume(Packet *p, uchar *buf, int n)
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
|
int packetcopy(Packet *p, uchar *buf, int offset, int n)
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
|
Packet* packetdup(Packet *p, int offset, int n)
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
|
Packet* packetforeign(uchar *buf, int n,
|
||||||
|
.br
|
||||||
|
.B
|
||||||
|
void (*free)(void *a), void *a)
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
|
int packetfragments(Packet *p, IOchunk *io, int nio,
|
||||||
|
.br
|
||||||
|
.B
|
||||||
|
int offset)
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
|
void packetfree(Packet *p)
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
|
uchar* packetheader(Packet *p, int n)
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
|
uchar* packetpeek(Packet *p, uchar *buf, int offset, int n)
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
|
void packetprefix(Packet *p, uchar *buf, int n)
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
void packetsha1(Packet *p, uchar sha1[20])
|
void packetsha1(Packet *p, uchar sha1[20])
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
|
uint packetsize(Packet *p)
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
|
Packet* packetsplit(Packet *p, int n)
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
|
void packetstats(void)
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
|
uchar* packettrailer(Packet *p, int n)
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
|
int packettrim(Packet *p, int offset, int n)
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
A
|
A
|
||||||
.B Packet
|
.B Packet
|
||||||
is a list of blocks of data.
|
is a chain of blocks of data.
|
||||||
Each block is contiguous in memory, but the entire packet
|
Each block, called a fragment,
|
||||||
|
is contiguous in memory, but the entire packet
|
||||||
may not be.
|
may not be.
|
||||||
This representation helps avoid unnecessary memory copies.
|
This representation helps avoid unnecessary memory copies.
|
||||||
.PP
|
.PP
|
||||||
|
@ -107,7 +123,7 @@ returns the number of data bytes allocated to
|
||||||
This may be larger than the number of bytes stored
|
This may be larger than the number of bytes stored
|
||||||
in
|
in
|
||||||
.IR p
|
.IR p
|
||||||
because individual fragments may not be filled.
|
because fragments may not be filled completely.
|
||||||
.PP
|
.PP
|
||||||
.I Packetcmp
|
.I Packetcmp
|
||||||
compares the data sections of two packets as
|
compares the data sections of two packets as
|
||||||
|
@ -214,7 +230,7 @@ computes the SHA1 hash of the data contained in
|
||||||
.IR p .
|
.IR p .
|
||||||
.PP
|
.PP
|
||||||
.I Packetsize
|
.I Packetsize
|
||||||
returns the number of bytes of data contained in
|
returns the length, in bytes, of the data contained in
|
||||||
.IR p .
|
.IR p .
|
||||||
.PP
|
.PP
|
||||||
.I Packetsplit
|
.I Packetsplit
|
||||||
|
@ -263,4 +279,3 @@ whose return values are described above.
|
||||||
When these functions run out of memory, they
|
When these functions run out of memory, they
|
||||||
print error messages and call
|
print error messages and call
|
||||||
.IR sysfatal .
|
.IR sysfatal .
|
||||||
They do not return.
|
|
||||||
|
|
|
@ -110,12 +110,13 @@ is a read-only Venti proxy (it rejects
|
||||||
.B write
|
.B write
|
||||||
requests).
|
requests).
|
||||||
.I Devnull
|
.I Devnull
|
||||||
is a write-only Venti server: it discards all
|
is a dangerous write-only Venti server: it discards all
|
||||||
blocks written to it and returns error on all reads.
|
blocks written to it and returns error on all reads.
|
||||||
.SH SOURCE
|
.SH SOURCE
|
||||||
.B \*9/src/libventi
|
.B \*9/src/libventi
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.IR venti (1),
|
|
||||||
.IR venti (3),
|
.IR venti (3),
|
||||||
.IR venti-conn (3),
|
.IR venti-conn (3),
|
||||||
.IR venti-packet (3)
|
.IR venti-packet (3),
|
||||||
|
.IR venti (7),
|
||||||
|
.IR venti (8)
|
|
@ -30,14 +30,14 @@ returns the size of the
|
||||||
buffer pointed to by
|
buffer pointed to by
|
||||||
.I buf
|
.I buf
|
||||||
ignoring trailing zeros or zero scores,
|
ignoring trailing zeros or zero scores,
|
||||||
according to the block type
|
according to the given
|
||||||
.IR type .
|
.IR type .
|
||||||
.PP
|
.PP
|
||||||
.I Vtzeroextend
|
.I Vtzeroextend
|
||||||
pads
|
pads
|
||||||
.I buf
|
.I buf
|
||||||
with zeros or zero scores,
|
with zeros or zero scores,
|
||||||
according to the block type
|
according to the given
|
||||||
.IR type ,
|
.IR type ,
|
||||||
to grow it from
|
to grow it from
|
||||||
.I size
|
.I size
|
||||||
|
@ -52,5 +52,5 @@ is the score of the zero-length block.
|
||||||
.br
|
.br
|
||||||
.B \*9/src/libventi/zeroscore.c
|
.B \*9/src/libventi/zeroscore.c
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.IR venti (1),
|
.IR venti (3),
|
||||||
.IR venti (3)
|
.IR venti (7)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
.TH VENTI 3
|
.TH VENTI 3
|
||||||
.SH NAME
|
.SH NAME
|
||||||
xxx \- Venti storage server
|
venti \- archival storage server
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.PP
|
.PP
|
||||||
.ft L
|
.ft L
|
||||||
|
@ -28,7 +28,7 @@ describe routines for writing clients
|
||||||
and servers on top of these.
|
and servers on top of these.
|
||||||
.PP
|
.PP
|
||||||
.IR Venti-fcall (3)
|
.IR Venti-fcall (3)
|
||||||
describes the in-memory representation of Venti protocol messages
|
describes the C representation of Venti protocol messages
|
||||||
and data structures.
|
and data structures.
|
||||||
It also describes routines that convert between the C representation
|
It also describes routines that convert between the C representation
|
||||||
and the network and disk representations.
|
and the network and disk representations.
|
||||||
|
@ -37,7 +37,7 @@ and the network and disk representations.
|
||||||
describes routines for writing clients that manipulate
|
describes routines for writing clients that manipulate
|
||||||
Venti file trees
|
Venti file trees
|
||||||
(see
|
(see
|
||||||
.IR venti (1)).
|
.IR venti (7)).
|
||||||
.PP
|
.PP
|
||||||
.IR Venti-log (3)
|
.IR Venti-log (3)
|
||||||
describes routines to access in-memory log buffers
|
describes routines to access in-memory log buffers
|
||||||
|
@ -51,13 +51,13 @@ routines that abort on error.
|
||||||
.PP
|
.PP
|
||||||
.IR Venti-packet (3)
|
.IR Venti-packet (3)
|
||||||
describes routines for
|
describes routines for
|
||||||
efficiently manipulating chains of
|
manipulating zero-copy chains of
|
||||||
data buffers.
|
data buffers.
|
||||||
.PP
|
.PP
|
||||||
.IR Venti-zero (3)
|
.IR Venti-zero (3)
|
||||||
describes routines to zero truncate and zero extend blocks
|
describes routines to zero truncate and zero extend blocks
|
||||||
(see
|
(see
|
||||||
.IR venti (1)).
|
.IR venti (7)).
|
||||||
.SH SOURCE
|
.SH SOURCE
|
||||||
.B \*9/src/libventi
|
.B \*9/src/libventi
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
|
|
151
man/man7/mpictures.7
Normal file
151
man/man7/mpictures.7
Normal file
|
@ -0,0 +1,151 @@
|
||||||
|
.TH MPICTURES 7
|
||||||
|
.SH NAME
|
||||||
|
mpictures \- picture inclusion macros
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B troff -mpictures
|
||||||
|
[
|
||||||
|
.I options
|
||||||
|
]
|
||||||
|
.I file ...
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.I Mpictures
|
||||||
|
macros insert PostScript pictures into
|
||||||
|
.IR troff (1)
|
||||||
|
documents.
|
||||||
|
The macros are:
|
||||||
|
.TP
|
||||||
|
.BI .BP " source height width position offset flags label
|
||||||
|
Define a frame and place a picture in it.
|
||||||
|
Null arguments, represented by \f5""\fR,
|
||||||
|
are interpreted as defaults.
|
||||||
|
The arguments are:
|
||||||
|
.RS
|
||||||
|
.TP
|
||||||
|
.I source
|
||||||
|
Name of a PostScript picture file, optionally
|
||||||
|
suffixed with
|
||||||
|
.RI ( n )
|
||||||
|
to select page number
|
||||||
|
.I n
|
||||||
|
from the file (first page by default).
|
||||||
|
.PD0
|
||||||
|
.TP
|
||||||
|
.I height
|
||||||
|
Vertical size of the frame, default
|
||||||
|
.BR 3.0i .
|
||||||
|
.TP
|
||||||
|
.I width
|
||||||
|
Horizontal size of the frame, current line length by default.
|
||||||
|
.TP
|
||||||
|
.I position
|
||||||
|
.L l
|
||||||
|
(default),
|
||||||
|
.LR c ,
|
||||||
|
or
|
||||||
|
.L r
|
||||||
|
to left-justify, center, or right-justify the frame.
|
||||||
|
.TP
|
||||||
|
.I offset
|
||||||
|
Move the frame horizontally from the original
|
||||||
|
.I position
|
||||||
|
by this amount, default
|
||||||
|
.BR 0i .
|
||||||
|
.TP
|
||||||
|
.I flags
|
||||||
|
One or more of:
|
||||||
|
.RS
|
||||||
|
.PD 0v
|
||||||
|
.TP
|
||||||
|
.BI a d
|
||||||
|
Rotate the picture clockwise
|
||||||
|
.I d
|
||||||
|
degrees, default
|
||||||
|
.IR d =90.
|
||||||
|
.TP
|
||||||
|
.B o
|
||||||
|
Outline the picture with a box.
|
||||||
|
.TP
|
||||||
|
.B s
|
||||||
|
Freely scale both picture dimensions.
|
||||||
|
.TP
|
||||||
|
.B w
|
||||||
|
White out the area to be occupied by the picture.
|
||||||
|
.TP
|
||||||
|
.BR l , r , t ,\fPb
|
||||||
|
Attach the picture to the left right, top, or bottom of the frame.
|
||||||
|
.RE
|
||||||
|
.TP
|
||||||
|
.I label
|
||||||
|
Place
|
||||||
|
.I label
|
||||||
|
at distance
|
||||||
|
.B 1.5v
|
||||||
|
below the frame.
|
||||||
|
.PD
|
||||||
|
.PP
|
||||||
|
If there's room,
|
||||||
|
.B .BP
|
||||||
|
fills text around the frame.
|
||||||
|
Everything destined for either side of the frame
|
||||||
|
goes into a diversion to be retrieved when the accumulated
|
||||||
|
text sweeps past the trap set by
|
||||||
|
.B .BP
|
||||||
|
or when the diversion is explicitly closed
|
||||||
|
by
|
||||||
|
.BR .EP .
|
||||||
|
.RE
|
||||||
|
.TP
|
||||||
|
.BI .PI " source height" , width , "yoffset\fB,\fPxoffset flags.
|
||||||
|
This low-level macro, used by
|
||||||
|
.BR .BP ,
|
||||||
|
can help do more complex things.
|
||||||
|
The two arguments not already described are:
|
||||||
|
.RS
|
||||||
|
.TP
|
||||||
|
.I xoffset
|
||||||
|
Offset the frame from the left margin by this amount, default
|
||||||
|
.BR 0i .
|
||||||
|
.PD0
|
||||||
|
.TP
|
||||||
|
.I yoffset
|
||||||
|
Offset the frame from the current baseline,
|
||||||
|
measuring positive downward, default
|
||||||
|
.BR 0i .
|
||||||
|
.PD
|
||||||
|
.RE
|
||||||
|
.TP
|
||||||
|
.B .EP
|
||||||
|
End a picture started by
|
||||||
|
.BR .BP ;
|
||||||
|
.B .EP
|
||||||
|
is usually called implicitly by a trap
|
||||||
|
at frame bottom.
|
||||||
|
.PP
|
||||||
|
If a PostScript file lacks page-delimiting comments,
|
||||||
|
the entire file is included.
|
||||||
|
If no
|
||||||
|
.B %%BoundingBox
|
||||||
|
comment is present, the picture is
|
||||||
|
assumed to fill an 8.5\(mu11-inch page.
|
||||||
|
Nothing prevents the picture from being placed off the page.
|
||||||
|
.SH SEE ALSO
|
||||||
|
.IR troff (1)
|
||||||
|
.SH DIAGNOSTICS
|
||||||
|
A picture file that can't be read by the PostScript
|
||||||
|
postprocessor is replaced by white space.
|
||||||
|
.SH BUGS
|
||||||
|
A picture and associated text silently disappear if
|
||||||
|
a diversion trap set by
|
||||||
|
.B .BP
|
||||||
|
isn't reached.
|
||||||
|
Call
|
||||||
|
.B .EP
|
||||||
|
at the end of the document to retrieve it.
|
||||||
|
.br
|
||||||
|
Macros in other packages may break the adjustments
|
||||||
|
made to the line length and indent when text is being placed
|
||||||
|
around a picture.
|
||||||
|
.br
|
||||||
|
A missing or improper
|
||||||
|
.B %%BoundingBox
|
||||||
|
comment may cause the frame to be filled incorrectly.
|
|
@ -17,19 +17,15 @@ block storage using Venti as well as the Venti network protocol.
|
||||||
.IR Venti (1)
|
.IR Venti (1)
|
||||||
documents some simple clients.
|
documents some simple clients.
|
||||||
.IR Vac (1),
|
.IR Vac (1),
|
||||||
.IR vbackup (1),
|
|
||||||
.IR vacfs (4),
|
.IR vacfs (4),
|
||||||
and
|
and
|
||||||
.IR vnfs (4)
|
.IR vbackup (8)
|
||||||
are more complex clients.
|
are more complex clients.
|
||||||
.PP
|
.PP
|
||||||
.IR Venti (3)
|
.IR Venti (3)
|
||||||
describes a C library interface for accessing
|
describes a C library interface for accessing
|
||||||
Venti servers and manipulating Venti data structures.
|
Venti servers and manipulating Venti data structures.
|
||||||
.PP
|
.PP
|
||||||
.IR Venti.conf (7)
|
|
||||||
describes the Venti server configuration file.
|
|
||||||
.PP
|
|
||||||
.IR Venti (8)
|
.IR Venti (8)
|
||||||
describes the programs used to run a Venti server.
|
describes the programs used to run a Venti server.
|
||||||
.PP
|
.PP
|
||||||
|
@ -86,9 +82,20 @@ Scores passed between programs conventionally refer
|
||||||
to
|
to
|
||||||
.B VtRoot
|
.B VtRoot
|
||||||
blocks, which contain descriptive information
|
blocks, which contain descriptive information
|
||||||
as well as the score of a block containing a small number
|
as well as the score of a directory block containing a small number
|
||||||
of
|
of directory entries.
|
||||||
.B VtEntries .
|
.PP
|
||||||
|
Conventionally, programs do not mix data and directory entries
|
||||||
|
in the same file. Instead, they keep two separate files, one with
|
||||||
|
directory entries and one with metadata referencing those
|
||||||
|
entries by position.
|
||||||
|
Keeping this parallel representation is a minor annoyance
|
||||||
|
but makes it possible for general programs like
|
||||||
|
.I venti/copy
|
||||||
|
(see
|
||||||
|
.IR venti (1))
|
||||||
|
to traverse the block tree without knowing the specific details
|
||||||
|
of any particular program's data.
|
||||||
.SS "Block Types
|
.SS "Block Types
|
||||||
To allow programs to traverse these structures without
|
To allow programs to traverse these structures without
|
||||||
needing to understand their higher-level meanings,
|
needing to understand their higher-level meanings,
|
||||||
|
@ -127,7 +134,7 @@ For example, if a 1024-byte data block contains the
|
||||||
followed by 1013 zero bytes,
|
followed by 1013 zero bytes,
|
||||||
a client would store only the 11-byte block.
|
a client would store only the 11-byte block.
|
||||||
When the client later read the block from the server,
|
When the client later read the block from the server,
|
||||||
it would append zeros to the end as necessary to
|
it would append zero bytes to the end as necessary to
|
||||||
reach the expected size.
|
reach the expected size.
|
||||||
.PP
|
.PP
|
||||||
When truncating pointer blocks
|
When truncating pointer blocks
|
||||||
|
@ -140,12 +147,12 @@ instead of trailing zero bytes.
|
||||||
.PP
|
.PP
|
||||||
Because of the truncation convention,
|
Because of the truncation convention,
|
||||||
any file consisting entirely of zero bytes,
|
any file consisting entirely of zero bytes,
|
||||||
no matter what the length, will be represented by the zero score:
|
no matter what its length, will be represented by the zero score:
|
||||||
the data blocks contain all zeros and are thus truncated
|
the data blocks contain all zeros and are thus truncated
|
||||||
to the empty block, and the pointer blocks contain all zero scores
|
to the empty block, and the pointer blocks contain all zero scores
|
||||||
and are thus also truncated to the empty block,
|
and are thus also truncated to the empty block,
|
||||||
and so on up the hash tree.
|
and so on up the hash tree.
|
||||||
.SS NETWORK PROTOCOL
|
.SS Network Protocol
|
||||||
A Venti session begins when a
|
A Venti session begins when a
|
||||||
.I client
|
.I client
|
||||||
connects to the network address served by a Venti
|
connects to the network address served by a Venti
|
||||||
|
@ -163,7 +170,7 @@ The
|
||||||
field is a list of acceptable versions separated by
|
field is a list of acceptable versions separated by
|
||||||
colons.
|
colons.
|
||||||
The protocol described here is version
|
The protocol described here is version
|
||||||
.B 02 .
|
.BR 02 .
|
||||||
The client is responsible for choosing a common
|
The client is responsible for choosing a common
|
||||||
version and sending it in the
|
version and sending it in the
|
||||||
.B VtThello
|
.B VtThello
|
||||||
|
@ -193,14 +200,14 @@ followed by
|
||||||
bytes of data.
|
bytes of data.
|
||||||
Text strings are represented similarly,
|
Text strings are represented similarly,
|
||||||
using a two-byte count with
|
using a two-byte count with
|
||||||
the text itself stored as a UTF-8 encoded sequence
|
the text itself stored as a UTF-encoded sequence
|
||||||
of Unicode characters (see
|
of Unicode characters (see
|
||||||
.IR utf (7)).
|
.IR utf (7)).
|
||||||
Text strings are not
|
Text strings are not
|
||||||
.SM NUL\c
|
.SM NUL\c
|
||||||
-terminated:
|
-terminated:
|
||||||
.I n
|
.I n
|
||||||
counts the bytes of UTF-8 data, which include no final
|
counts the bytes of UTF data, which include no final
|
||||||
zero byte.
|
zero byte.
|
||||||
The
|
The
|
||||||
.SM NUL
|
.SM NUL
|
||||||
|
@ -215,7 +222,7 @@ in the enumeration in the include file
|
||||||
.BR <venti.h> .
|
.BR <venti.h> .
|
||||||
The next byte is an identifying
|
The next byte is an identifying
|
||||||
.IR tag ,
|
.IR tag ,
|
||||||
used to match responses with requests.
|
used to match responses to requests.
|
||||||
The remaining bytes are parameters of different sizes.
|
The remaining bytes are parameters of different sizes.
|
||||||
In the message descriptions, the number of bytes in a field
|
In the message descriptions, the number of bytes in a field
|
||||||
is given in brackets after the field name.
|
is given in brackets after the field name.
|
||||||
|
@ -382,7 +389,7 @@ The
|
||||||
message requests a block with the given
|
message requests a block with the given
|
||||||
.I score
|
.I score
|
||||||
and
|
and
|
||||||
.I type .
|
.IR type .
|
||||||
Use
|
Use
|
||||||
.I vttodisktype
|
.I vttodisktype
|
||||||
and
|
and
|
||||||
|
|
|
@ -30,11 +30,6 @@ back up Unix file systems to Venti
|
||||||
.B >
|
.B >
|
||||||
.I disk
|
.I disk
|
||||||
.PP
|
.PP
|
||||||
.B vftp
|
|
||||||
.I disk
|
|
||||||
|
|
|
||||||
.I score
|
|
||||||
.PP
|
|
||||||
.B vmount
|
.B vmount
|
||||||
[
|
[
|
||||||
.B -v
|
.B -v
|
||||||
|
@ -42,30 +37,15 @@ back up Unix file systems to Venti
|
||||||
.I addr
|
.I addr
|
||||||
.I mtpt
|
.I mtpt
|
||||||
.PP
|
.PP
|
||||||
.B vmount0
|
|
||||||
[
|
|
||||||
.B -v
|
|
||||||
]
|
|
||||||
[
|
|
||||||
.B -h
|
|
||||||
.I handle
|
|
||||||
]
|
|
||||||
.I addr
|
|
||||||
.I mtpt
|
|
||||||
.PP
|
|
||||||
.B vnfs
|
.B vnfs
|
||||||
[
|
[
|
||||||
.B -LLMRVr
|
.B -ELLRVr
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
.B -a
|
.B -a
|
||||||
.I addr
|
.I addr
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
.B -m
|
|
||||||
.I mntaddr
|
|
||||||
]
|
|
||||||
[
|
|
||||||
.B -b
|
.B -b
|
||||||
.I blocksize
|
.I blocksize
|
||||||
]
|
]
|
||||||
|
@ -128,46 +108,68 @@ The options to
|
||||||
are:
|
are:
|
||||||
.TP
|
.TP
|
||||||
.B -D
|
.B -D
|
||||||
|
Turn on debugging output.
|
||||||
.TP
|
.TP
|
||||||
.B -V
|
.B -V
|
||||||
|
Trace interactions with Venti server.
|
||||||
|
.TP
|
||||||
|
.B -m \fImntname
|
||||||
|
Set backup name
|
||||||
|
(defaults to
|
||||||
|
.IR sysname (3)):
|
||||||
|
this name is used in the printed
|
||||||
|
.B mount
|
||||||
|
command.
|
||||||
.TP
|
.TP
|
||||||
.B -n
|
.B -n
|
||||||
|
No-op mode: do not write any blocks to the server
|
||||||
.TP
|
.TP
|
||||||
.B -v
|
.B -v
|
||||||
|
Print verbose output.
|
||||||
.TP
|
.TP
|
||||||
.B -w \fIn
|
.B -w \fIn
|
||||||
|
Write parallelism: keep
|
||||||
|
.I n
|
||||||
|
writes to the server in progress at a time.
|
||||||
.TP
|
.TP
|
||||||
.B -s \fIsecs
|
.B -s \fIsecs
|
||||||
|
Status interval: every
|
||||||
|
.I secs
|
||||||
|
seconds, print a line tracking progress of the backup.
|
||||||
|
.PD
|
||||||
|
.PP
|
||||||
|
When
|
||||||
|
.I vbackup
|
||||||
|
finishes, it prints a single line of the form
|
||||||
|
.IP
|
||||||
|
.EX
|
||||||
|
mount /\fImntname\fL/\fIyyyy\fL/\fImmdd\fL/\fImntpath\fL \fIscore\fL \fIyyyy\fL/\fImmdd\fL/\fIhhmm
|
||||||
|
.EE
|
||||||
|
.LP
|
||||||
|
This line is a valid configuration line for
|
||||||
|
.I vnfs
|
||||||
|
.RI ( q.v. ).
|
||||||
|
.I Mntpath
|
||||||
|
is the path on which
|
||||||
|
.I disk
|
||||||
|
is currently mounted.
|
||||||
.PP
|
.PP
|
||||||
.I Vcat
|
.I Vcat
|
||||||
writes the named disk image to standard output.
|
writes the named disk image to standard output.
|
||||||
Unused file system blocks are printed zeroed regardless
|
Unused file system blocks are printed zeroed regardless
|
||||||
of their actual content.
|
of their actual content.
|
||||||
.PP
|
.PP
|
||||||
If the
|
By default,
|
||||||
.B -z
|
|
||||||
flag is given,
|
|
||||||
.I vcat
|
.I vcat
|
||||||
will attempt to seek over unused blocks instead of writing to them.
|
will assume that its standard output is seekable
|
||||||
|
.RI ( i.e.,
|
||||||
|
it has been redirected to a file or disk)
|
||||||
|
and seek over unused blocks instead of writing to them.
|
||||||
The
|
The
|
||||||
.B -z
|
.B -z
|
||||||
flag should only be used when standard output is seekable
|
option causes
|
||||||
.RI ( i.e. ,
|
.I vcat
|
||||||
when it has been redirected to a file or disk).
|
to zero unused blocks instead.
|
||||||
.PP
|
|
||||||
.I Vftp
|
|
||||||
presents the
|
|
||||||
file system image named by
|
|
||||||
.I disk
|
|
||||||
or
|
|
||||||
.I score
|
|
||||||
in a shell-like
|
|
||||||
interactive session.
|
|
||||||
Type
|
|
||||||
.B help
|
|
||||||
at the
|
|
||||||
.B vftp>
|
|
||||||
prompt for details.
|
|
||||||
.PP
|
.PP
|
||||||
.I Vmount
|
.I Vmount
|
||||||
mounts the NFS service at the network connection
|
mounts the NFS service at the network connection
|
||||||
|
@ -179,13 +181,6 @@ On most operating systems,
|
||||||
must be run by the user
|
must be run by the user
|
||||||
.BR root .
|
.BR root .
|
||||||
.PP
|
.PP
|
||||||
.I Vmount0
|
|
||||||
is a simple C program that
|
|
||||||
.I vmount
|
|
||||||
uses if
|
|
||||||
.IR mount (8)
|
|
||||||
does not suffice.
|
|
||||||
.PP
|
|
||||||
.I Vnfs
|
.I Vnfs
|
||||||
serves, using the
|
serves, using the
|
||||||
NFS version 3 protocol,
|
NFS version 3 protocol,
|
||||||
|
@ -193,40 +188,123 @@ one or more disk images in a synthetic tree defined
|
||||||
by the configuration file
|
by the configuration file
|
||||||
.IR config .
|
.IR config .
|
||||||
.I Vnfs
|
.I Vnfs
|
||||||
announces NFS service at
|
serves both NFS mount protocol
|
||||||
|
and NFS protocol
|
||||||
|
RPCs at
|
||||||
.IR addr
|
.IR addr
|
||||||
(default
|
(default
|
||||||
.BR udp!*!nfs )
|
.BR udp!*!nfs ).
|
||||||
and NFS mount service at
|
|
||||||
.IR mntaddr
|
|
||||||
(default
|
|
||||||
.BR udp!*!\fI999 ),
|
|
||||||
registering both with the port mapper.
|
|
||||||
If no port mapper is found running (on port 111),
|
|
||||||
.I vnfs
|
|
||||||
starts its own port mapper.
|
|
||||||
The options are:
|
The options are:
|
||||||
.TP
|
.TP
|
||||||
|
.B -E
|
||||||
|
Disable `encrypted' handles.
|
||||||
|
By default handles are encrypted with a random key to avoid
|
||||||
|
leaking information about the backed-up file systems.
|
||||||
|
If encryption is disabled, the NFS handles exposed to the client
|
||||||
|
may leak information about the root scores of the disks as well
|
||||||
|
as inode numbers.
|
||||||
|
.TP
|
||||||
|
.B -L
|
||||||
|
Local service only: serve only requests from the loopback interface (127.0.0.1).
|
||||||
|
.TP
|
||||||
|
.B -LL
|
||||||
|
Local service only, with paranoia: serve only requests from loopback,
|
||||||
|
and only from the first source port that sends a request.
|
||||||
|
This option is intended to be used to make sure that once the local
|
||||||
|
host has mounted the service, no other local users can access it.
|
||||||
|
.TP
|
||||||
|
.B -R
|
||||||
|
Print all NFS and NFS mount RPCs to standard error.
|
||||||
|
.TP
|
||||||
|
.B -V
|
||||||
|
Print all Venti transactions to standard error.
|
||||||
|
.TP
|
||||||
|
.BI -a " addr
|
||||||
|
Serve requests on
|
||||||
|
.IR addr
|
||||||
|
(see above).
|
||||||
|
.TP
|
||||||
|
.BI -b " blocksize
|
||||||
|
Set block size used by the in-memory venti block cache.
|
||||||
|
Must be as large as the maximum block size in any
|
||||||
|
file system mentioned in the configuration.
|
||||||
|
.TP
|
||||||
|
.BI -c " cachesize
|
||||||
|
Set the number of blocks stored by the in-memory venti cache.
|
||||||
|
.TP
|
||||||
.B -r
|
.B -r
|
||||||
Reply to all NFS requests with RPC rejections.
|
Respond to all requests with a Sun RPC rejection.
|
||||||
|
This is useful during debugging.
|
||||||
|
.PD
|
||||||
|
.PP
|
||||||
|
.I Config
|
||||||
|
is a text file describing the
|
||||||
|
backup hierarchy for
|
||||||
|
.I vnfs
|
||||||
|
to serve.
|
||||||
|
Lines beginning with a sharp
|
||||||
|
.RB ( # )
|
||||||
|
are ignored.
|
||||||
|
The rest of the file is a sequence of commands, one per line.
|
||||||
|
The commands are:
|
||||||
.TP
|
.TP
|
||||||
.B -M
|
.BI mount " mtpt score time
|
||||||
Do not announce an NFS mount service.
|
Add the file system with the given
|
||||||
|
.I score
|
||||||
|
to the tree at the mount point
|
||||||
|
.IR mtpt .
|
||||||
|
The path to the mount point will be created
|
||||||
|
if necessary.
|
||||||
|
If
|
||||||
|
.B /dev/null
|
||||||
|
is given as the score, an empty file system is mounted at
|
||||||
|
.IR mtpt ,
|
||||||
|
excluding
|
||||||
|
.IR mtpt 's
|
||||||
|
contents from view.
|
||||||
|
.I Time
|
||||||
|
is the modification time to return for the directory
|
||||||
|
.IR mtpt ,
|
||||||
|
either a decimal number of seconds since the epoch
|
||||||
|
or a string of the form
|
||||||
|
.IB yyyy / mmdd / hhmm
|
||||||
|
giving the year, month, day, hour, and minute.
|
||||||
|
.RI ( Vnfs
|
||||||
|
does not use the modification time of the root in order
|
||||||
|
to avoid accessing every mounted file system on common
|
||||||
|
actions like
|
||||||
|
.B ls
|
||||||
|
.B -l
|
||||||
|
.BR /dump/sys/2005 .)
|
||||||
.TP
|
.TP
|
||||||
.B -P
|
.BI allow " ip\fR[\fL/\fImask\fR]
|
||||||
Do not register service with the port mapper.
|
|
||||||
.TP
|
.TP
|
||||||
.B -a
|
.BI deny " ip\fR[\fL/\fImask\fR]
|
||||||
|
These two commands define access permissions based on IP address.
|
||||||
|
The optional
|
||||||
|
.I mask
|
||||||
|
can be a decimal number (24) or an equivalent IP mask (255.255.255.0).
|
||||||
|
Each request is filtered through the rules listed in the configuration file.
|
||||||
|
The first rule that matches is used.
|
||||||
|
If any
|
||||||
|
.B allow
|
||||||
|
or
|
||||||
|
.B deny
|
||||||
|
rules are given, the default action is to reject the request.
|
||||||
|
In the absence of any rules, the default action is to accept all requests.
|
||||||
|
.PD
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
.PP
|
.PP
|
||||||
Back up the file system stored on
|
Running on the server
|
||||||
.BR /dev/da0s1a :
|
.IR bob ,
|
||||||
|
back up the file system stored on
|
||||||
|
.BR /dev/da0s1a ,
|
||||||
|
which is mounted on
|
||||||
|
.BR /home :
|
||||||
.IP
|
.IP
|
||||||
.EX
|
.EX
|
||||||
% vbackup /dev/da0s1a
|
% vbackup /dev/da0s1a
|
||||||
ffs:0123456789abcdef0123456789abcdef01234567
|
mount /bob/2005/0510/home ffs:0123456789abcdef\fI...\fP 2005/0510/0831
|
||||||
%
|
%
|
||||||
.EE
|
.EE
|
||||||
.PP
|
.PP
|
||||||
|
@ -236,12 +314,13 @@ of Plan 9's dump file system, but hide each day's contents of
|
||||||
.IP
|
.IP
|
||||||
.EX
|
.EX
|
||||||
% cat config
|
% cat config
|
||||||
mount /2005/0510 ffs:0123456789abcdef\fI...\fP
|
mount /bob/2005/0510 ffs:0123456789abcdef\fI...\fP 2005/0510/0829
|
||||||
mount /2005/0510/home ffs:0123456789abcdef\fI...\fP
|
mount /bob/2005/0510/home ffs:0123456789abcdef\fI...\fP 2005/0510/0831
|
||||||
mount /2005/0510 ffs:0123456789abcdef\fI...\fP
|
mount /bob/2005/0510/tmp /dev/null 1
|
||||||
mount /2005/0510/home ffs:0123456789abcdef\fI...\fP
|
mount /bob/2005/0511 ffs:0123456789abcdef\fI...\fP 2005/0511/0827
|
||||||
hide /*/*/tmp
|
mount /bob/2005/0511/home ffs:0123456789abcdef\fI...\fP 2005/0511/0828
|
||||||
% vnfs -m -b 16k -c 1k config
|
mount /bob/2005/0511/tmp /dev/null 1
|
||||||
|
% vnfs -b 16k -c 1k config
|
||||||
%
|
%
|
||||||
.EE
|
.EE
|
||||||
.PP
|
.PP
|
||||||
|
@ -250,14 +329,11 @@ Mount the backups on a client machine using
|
||||||
.IP
|
.IP
|
||||||
.EX
|
.EX
|
||||||
# vmount udp!yourserver!nfs /dump
|
# vmount udp!yourserver!nfs /dump
|
||||||
# ls /dump
|
# ls /dump/bob/2005
|
||||||
2005
|
0510
|
||||||
|
0511
|
||||||
#
|
#
|
||||||
.EE
|
.EE
|
||||||
.PP
|
.PP
|
||||||
Mount the backups using the standard NFS mount program:
|
(Users of fancy shells may need to quote the address argument.)
|
||||||
.IP
|
|
||||||
.EX
|
|
||||||
# mount -t nfs -o soft,intr,ro,nfsv3,rsize=8192,timeo=100 \
|
|
||||||
-o nfsvers=3,nolock,noatime,nodev,nosuid \
|
|
||||||
.EE
|
|
||||||
|
|
|
@ -1,6 +1,41 @@
|
||||||
.TH VENTI 8
|
.TH VENTI 8
|
||||||
.SH NAME
|
.SH NAME
|
||||||
venti.conf \- venti configuration
|
venti \- archival storage server
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B venti/venti
|
||||||
|
[
|
||||||
|
.B -Ldsw
|
||||||
|
]
|
||||||
|
[
|
||||||
|
.B -a
|
||||||
|
.I address
|
||||||
|
]
|
||||||
|
[
|
||||||
|
.B -B
|
||||||
|
.I blockcachesize
|
||||||
|
]
|
||||||
|
[
|
||||||
|
.B -c
|
||||||
|
.I config
|
||||||
|
]
|
||||||
|
.PP
|
||||||
|
.B " "
|
||||||
|
[
|
||||||
|
.B -C
|
||||||
|
.I lumpcachesize
|
||||||
|
]
|
||||||
|
[
|
||||||
|
.B -h
|
||||||
|
.I httpaddress
|
||||||
|
]
|
||||||
|
[
|
||||||
|
.B -I
|
||||||
|
.I indexcachesize
|
||||||
|
]
|
||||||
|
[
|
||||||
|
.B -W
|
||||||
|
.I webroot
|
||||||
|
]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Venti is a SHA1-addressed archival storage server.
|
Venti is a SHA1-addressed archival storage server.
|
||||||
See
|
See
|
||||||
|
@ -83,12 +118,10 @@ and the total bitmap size
|
||||||
.PP
|
.PP
|
||||||
The bloom filter should be sized so that
|
The bloom filter should be sized so that
|
||||||
.I nhash
|
.I nhash
|
||||||
\(ti
|
\(mu
|
||||||
.I nblock
|
.I nblock
|
||||||
\(ti
|
|
||||||
0.7
|
|
||||||
\(<=
|
\(<=
|
||||||
0.7 \(ti
|
0.7 \(mu
|
||||||
.IR b ,
|
.IR b ,
|
||||||
where
|
where
|
||||||
.I nblock
|
.I nblock
|
||||||
|
@ -349,22 +382,17 @@ or
|
||||||
(case-insensitive)
|
(case-insensitive)
|
||||||
to indicate kilobytes, megabytes, or gigabytes respectively.
|
to indicate kilobytes, megabytes, or gigabytes respectively.
|
||||||
.SS Command Line
|
.SS Command Line
|
||||||
Options to
|
Many of the options to Venti duplicate parameters that
|
||||||
.I venti
|
can be specified in the configuration file.
|
||||||
are:
|
The command line options override those found in a
|
||||||
|
configuration file.
|
||||||
|
Additional options are:
|
||||||
.TP
|
.TP
|
||||||
.BI -c " config
|
.BI -c " config
|
||||||
The server configuration file
|
The server configuration file
|
||||||
(default
|
(default
|
||||||
.BR venti.conf )
|
.BR venti.conf )
|
||||||
.TP
|
.TP
|
||||||
.BI -o " line
|
|
||||||
Set a server parameter, using the same syntax
|
|
||||||
as in the configuration file.
|
|
||||||
The
|
|
||||||
.B -o
|
|
||||||
options override the configuration file.
|
|
||||||
.TP
|
|
||||||
.B -d
|
.B -d
|
||||||
Produce various debugging information on standard error.
|
Produce various debugging information on standard error.
|
||||||
Implies
|
Implies
|
||||||
|
@ -413,6 +441,8 @@ Start the server and check the storage statistics:
|
||||||
% venti/venti
|
% venti/venti
|
||||||
% hget http://$sysname/storage
|
% hget http://$sysname/storage
|
||||||
.EE
|
.EE
|
||||||
|
.SH SOURCE
|
||||||
|
.B \*9/src/cmd/venti/srv
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.IR venti (1),
|
.IR venti (1),
|
||||||
.IR venti (3),
|
.IR venti (3),
|
||||||
|
@ -429,3 +459,14 @@ Setting up a venti server is too complicated.
|
||||||
.PP
|
.PP
|
||||||
Venti should not require the user to decide how to
|
Venti should not require the user to decide how to
|
||||||
partition its memory usage.
|
partition its memory usage.
|
||||||
|
.PP
|
||||||
|
Users of shells other than
|
||||||
|
.IR rc (1)
|
||||||
|
will not be able to use the program names shown.
|
||||||
|
One solution is to define
|
||||||
|
.B "V=$PLAN9/bin/venti"
|
||||||
|
and then substitute
|
||||||
|
.B $V/
|
||||||
|
for
|
||||||
|
.B venti/
|
||||||
|
in the paths above.
|
||||||
|
|
Loading…
Reference in a new issue