3 vtconnect, vthello, vtread, vtwrite, vtreadpacket, vtwritepacket, vtsync, vtping, vtrpc, ventidoublechecksha1 \- Venti client
11 .ta +\w'\fLextern int 'u +\w'\fLxxxxxxxx'u
14 Packet* vtrpc(VtConn *z, Packet *p)
17 int vthello(VtConn *z)
20 int vtconnect(VtConn *z)
23 int vtread(VtConn *z, uchar score[VtScoreSize],
26 uint type, uchar *buf, int n)
29 int vtwrite(VtConn *z, uchar score[VtScoreSize],
32 uint type, uchar *buf, int n)
35 Packet* vtreadpacket(VtConn *z, uchar score[VtScoreSize],
41 int vtwritepacket(VtConn *z, uchar score[VtScoreSize],
53 extern int ventidoublechecksha1; /* default 1 */
55 These routines execute the client side of the
60 executes a single Venti RPC transaction, sending the request
63 and then waiting for and returning the response packet.
65 will set the tag in the packet.
71 is typically called only indirectly, via the functions below.
78 .IR venti (7)), setting
80 to the name used by the server.
82 is typically called only indirectly, via
92 in that order, returning success only
94 This sequence (calling
98 must be done before the functions below can be called.
101 reads the block with the given
106 writes the returned data
109 and returns the number of bytes retrieved.
110 If the stored block has size larger than
135 but return or accept the block contents in the
138 They avoid making a copy of the data.
141 causes the server to flush all pending write requests
142 to disk before returning.
145 executes a ping transaction with the server.
151 check that the SHA1 hash of the returned data
152 matches the requested
158 check that the returned
160 matches the SHA1 hash of the written data.
162 .I ventidoublechecksha1
163 to zero disables these extra checks,
164 mainly for benchmarking purposes.
165 Doing so in production code is not recommended.
167 These functions can be called from multiple threads
168 or procs simultaneously to issue requests
170 Programs that issue requests from multiple threads
171 in the same proc should start separate procs running
183 .IR venti-packet (3),
190 The other routines return \-1 on error.
193 returns 0 on success,
194 meaning it wrote the entire block.