backport to buster
[hcoop/debian/openafs.git] / src / vlserver / vlserver_internal.h
CommitLineData
805e021f
CE
1/*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
4 *
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
8 */
9
10#ifndef _VLSERVER_INTERNAL_H
11#define _VLSERVER_INTERNAL_H
12
13/**
14 * context for a transaction of a single VL operation.
15 */
16struct vl_ctx {
17 struct ubik_trans *trans;
18 afs_uint32 *hostaddress;
19 struct extentaddr **ex_addr;
20 struct vlheader *cheader;
21};
22
23/* vlprocs.c */
24extern int Init_VLdbase(struct vl_ctx *ctx, int locktype, int this_op);
25
26/* vlutils.c */
27extern afs_int32 vlwrite(struct ubik_trans *trans, afs_int32 offset,
28 void *buffer, afs_int32 length);
29extern afs_int32 vlentrywrite(struct ubik_trans *trans, afs_int32 offset,
30 void *buffer, afs_int32 length);
31extern int write_vital_vlheader(struct vl_ctx *ctx);
32extern afs_int32 readExtents(struct ubik_trans *trans);
33extern afs_int32 CheckInit(struct ubik_trans *trans, int builddb);
34extern afs_int32 AllocBlock(struct vl_ctx *ctx,
35 struct nvlentry *tentry);
36extern afs_int32 FindExtentBlock(struct vl_ctx *ctx, afsUUID *uuidp,
37 afs_int32 createit, afs_int32 hostslot,
38 struct extentaddr **expp, afs_int32 *basep);
39extern afs_int32 FindByID(struct vl_ctx *ctx, afs_uint32 volid,
40 afs_int32 voltype, struct nvlentry *tentry,
41 afs_int32 *error);
42extern afs_int32 FindByName(struct vl_ctx *ctx, char *volname,
43 struct nvlentry *tentry, afs_int32 *error);
44extern int EntryIDExists(struct vl_ctx *ctx, const afs_uint32 *ids,
45 afs_int32 ids_len, afs_int32 *error);
46extern afs_uint32 NextUnusedID(struct vl_ctx *ctx, afs_uint32 maxvolid,
47 afs_uint32 bump, afs_int32 *error);
48extern int HashNDump(struct vl_ctx *ctx, int hashindex);
49extern int HashIdDump(struct vl_ctx *ctx, int hashindex);
50extern int ThreadVLentry(struct vl_ctx *ctx, afs_int32 blockindex,
51 struct nvlentry *tentry);
52extern int UnthreadVLentry(struct vl_ctx *ctx, afs_int32 blockindex,
53 struct nvlentry *aentry);
54extern int HashVolid(struct vl_ctx *ctx, afs_int32 voltype,
55 afs_int32 blockindex, struct nvlentry *tentry);
56extern int UnhashVolid(struct vl_ctx *ctx, afs_int32 voltype,
57 afs_int32 blockindex, struct nvlentry *aentry);
58extern int HashVolname(struct vl_ctx *ctx, afs_int32 blockindex,
59 struct nvlentry *aentry);
60extern int UnhashVolname(struct vl_ctx *ctx, afs_int32 blockindex,
61 struct nvlentry *aentry);
62extern afs_int32 NextEntry(struct vl_ctx *ctx, afs_int32 blockindex,
63 struct nvlentry *tentry, afs_int32 *remaining);
64extern int FreeBlock(struct vl_ctx *ctx, afs_int32 blockindex);
65extern int vlsetcache(struct vl_ctx *ctx, int locktype);
66extern int vlsynccache(void);
67#endif