2 * (C) COPYRIGHT IBM CORPORATION 1987, 1988
3 * LICENSED MATERIALS - PROPERTY OF IBM
9 #include "vl_opcodes.h"
10 %#include "vl_opcodes.h" /* directly to other places */
13 %#define xdr_array(a,b,c,d,e,f) xdr_arrayN(a,b,c,d,e,f)
14 %#include "../afs/longc_procs.h"
17 /* Current limitations on parameters that affect other packages (i.e. volume) */
18 const VLDBVERSION_4 = 4;
19 const VLDBVERSION = 3;
20 const OVLDBVERSION = 2;
21 const VL_MAXNAMELEN = 65;
22 const OMAXNSERVERS = 8;
23 const NMAXNSERVERS = 13;
26 /* Structure used by the VLUpdateEntry routine; multiple entries can be updated at once by setting the appropriate Mask bits. */
27 struct VldbUpdateEntry {
29 char name[VL_MAXNAMELEN];
32 afs_uint32 ReadOnlyId;
35 afs_int32 nModifiedRepsites;
36 afs_uint32 RepsitesMask[OMAXNSERVERS];
37 afs_int32 RepsitesTargetServer[OMAXNSERVERS];
38 afs_int32 RepsitesTargetPart[OMAXNSERVERS];
39 afs_int32 RepsitesNewServer[OMAXNSERVERS];
40 afs_int32 RepsitesNewPart[OMAXNSERVERS];
41 afs_int32 RepsitesNewFlags[OMAXNSERVERS];
44 /* struct VldbUpdateEntry Mask bit values */
45 const VLUPDATE_VOLUMENAME = 0x0001;
46 /*const VLUPDATE_VOLUMETYPE = 0x0002;*/
47 const VLUPDATE_FLAGS = 0x0004;
48 const VLUPDATE_READONLYID = 0x0008;
49 const VLUPDATE_BACKUPID = 0x0010;
50 const VLUPDATE_REPSITES = 0x0020;
51 const VLUPDATE_CLONEID = 0x0080;
52 const VLUPDATE_VOLNAMEHASH = 0x0100;
53 const VLUPDATE_RWID = 0x0200;
55 /* struct VldbUpdateEntry RepsitesMask[i] bit values */
56 const VLUPDATE_REPS_DELETE = 0x0100;
57 const VLUPDATE_REPS_ADD = 0x0200;
58 const VLUPDATE_REPS_MODSERV = 0x0400;
59 const VLUPDATE_REPS_MODPART = 0x0800;
60 const VLUPDATE_REPS_MODFLAG = 0x1000;
62 const VLSERVER_FLAG_UUID = 0x0010;
64 /*typedef string volumename<VL_MAXNAMELEN>;*/
66 const DEFAULTBULK = 10000;
67 typedef opaque bulk<DEFAULTBULK>;
69 /* Structure used by the VLListAttributes routine */
70 struct VldbListByAttributes {
79 /* struct VldbListByAttributes Mask bit values */
80 const VLLIST_SERVER = 0x1;
81 const VLLIST_PARTITION= 0x2;
82 /*const VLLIST_VOLUMETYPE= 0x4;*/
83 const VLLIST_VOLUMEID= 0x8;
84 const VLLIST_FLAG= 0x10;
86 /* External (visible) representation of an individual vldb entry */
88 char name[VL_MAXNAMELEN]; /* Volume name */
90 afs_int32 nServers; /* Number of servers that have this volume */
91 afs_int32 serverNumber[OMAXNSERVERS]; /* Server # for each server that holds volume */
92 afs_int32 serverPartition[OMAXNSERVERS]; /* Server Partition number */
93 afs_int32 serverFlags[OMAXNSERVERS]; /* Server flags */
94 afs_uint32 volumeId[MAXTYPES]; /* Corresponding volume of each type */
95 afs_int32 cloneId; /* Used during cloning */
96 afs_int32 flags; /* General flags */
100 char name[VL_MAXNAMELEN]; /* Volume name */
101 afs_int32 nServers; /* Number of servers that have this volume */
102 afs_int32 serverNumber[NMAXNSERVERS]; /* Server # for each server that holds volume */
103 afs_int32 serverPartition[NMAXNSERVERS]; /* Server Partition number */
104 afs_int32 serverFlags[NMAXNSERVERS]; /* Server flags */
105 afs_uint32 volumeId[MAXTYPES]; /* Corresponding volume of each type */
106 afs_int32 cloneId; /* Used during cloning */
107 afs_int32 flags; /* General flags */
108 afs_int32 matchindex;
120 struct ListAddrByAttributes {
127 const VLADDR_IPADDR = 0x1;
128 const VLADDR_INDEX = 0x2;
129 const VLADDR_UUID = 0x4;
132 char name[VL_MAXNAMELEN]; /* Volume name */
133 afs_int32 nServers; /* Number of servers that have this volume */
134 afsUUID serverNumber[NMAXNSERVERS]; /* Server # for each server that holds volume */
135 afs_int32 serverUnique[NMAXNSERVERS]; /* Server unique address */
136 afs_int32 serverPartition[NMAXNSERVERS]; /* Server Partition number */
137 afs_int32 serverFlags[NMAXNSERVERS]; /* Server flags */
138 afs_uint32 volumeId[MAXTYPES]; /* Corresponding volume of each type */
139 afs_int32 cloneId; /* Used during cloning */
140 afs_int32 flags; /* General flags */
141 afs_int32 spares1; /* The server index we matched */
153 /* Leading section of the vldb header (vlheader); contains frequently used globals and general statistics information */
154 struct vital_vlheader {
155 afs_int32 vldbversion; /* vldb version number--must be 1st */
156 afs_int32 headersize; /* total bytes in header */
157 afs_int32 freePtr; /* first (if any) free enry in freelist */
158 afs_int32 eofPtr; /* first free byte in file */
159 afs_int32 allocs; /* total calls to AllocBlock */
160 afs_int32 frees; /* total calls to FreeBlock */
161 afs_int32 MaxVolumeId; /* Global volume id holder */
162 afs_int32 totalEntries[MAXTYPES]; /* Total entries by voltype in vldb */
165 /* General stats on opcode hit frequency */
166 const MAX_NUMBER_OPCODES = 50;
168 afs_uint32 start_time; /* Time statistics were last cleared */
169 afs_int32 requests[MAX_NUMBER_OPCODES]; /* requests of each type */
170 afs_int32 aborts[MAX_NUMBER_OPCODES]; /* aborts of each type */
171 afs_int32 reserved[5]; /* for future usage */
175 /* defines for convenience of vl users */
176 %#define VLF_RWEXISTS 0x1000 /* flags for whole vldb entry */
177 %#define VLF_ROEXISTS 0x2000
178 %#define VLF_BACKEXISTS 0x4000
179 %#define VLF_DFSFILESET 0x8000 /* Volume is really DFS fileset */
180 %#define VLSF_NEWREPSITE 0x01 /* flags for indiv. server entry */
181 %#define VLSF_ROVOL 0x02
182 %#define VLSF_RWVOL 0x04
183 %#define VLSF_BACKVOL 0x08
184 %#define VLSF_DONTUSE 0x20 /* no conflict with VLSERVER_FLAG_UUID */
186 typedef vldbentry bulkentries<>;
187 typedef nvldbentry nbulkentries<>;
188 typedef uvldbentry ubulkentries<>;
189 typedef afs_uint32 bulkaddrs<>;
192 afs_uint32 CallBackVersion;
193 afs_uint32 ExpirationTime;
194 afs_uint32 CallBackType;
198 /* vldb interface calls */
201 * The kernel needs to be able to use a subset of these.
203 * Rather than try to make sure the all the kernels have
204 * all the necessary xdr routines for *all* the interfaces,
205 * we arrange that only the ones necessary for the kernel
206 * get compiled in the kernel.
210 * VL_Probe was renamed to VL_ProbeServer to avoid namespace collisions
218 * VL_GetEntryByName was renamed to VL_GetEntryByNameO to avoid
219 * namespace collisions with DFS clients.
223 IN string volumename<VL_MAXNAMELEN>,
225 ) = VLGETENTRYBYNAME;
228 IN string volumename<VL_MAXNAMELEN>,
229 OUT nvldbentry *entry
230 ) = VLGETENTRYBYNAMEN;
233 IN string volumename<VL_MAXNAMELEN>,
234 OUT uvldbentry *entry
235 ) = VLGETENTRYBYNAMEU;
238 IN ListAddrByAttributes *inaddr,
240 OUT afs_int32 *uniquifier,
241 OUT afs_int32 *nentries,
242 OUT bulkaddrs *blkaddrs
246 * The rest of the interfaces are not needed in the kernel
249 %#if !defined(KERNEL)
251 typedef struct single_vldbentry *vldblist;
253 struct single_vldbentry {
262 typedef struct single_nvldbentry *nvldblist;
264 struct single_nvldbentry {
265 nvldbentry VldbEntry;
274 IN vldbentry *newentry
289 IN afs_int32 bumpcount,
290 OUT afs_int32 *newvolumid
291 ) = VLGETNEWVOLUMEID;
297 afs_int32 ReleaseType
303 VldbUpdateEntry *UpdateEntry,
304 afs_int32 ReleaseType
316 afs_int32 ReleaseType
320 IN afs_int32 previous_index,
321 OUT afs_int32 *count,
322 afs_int32 *next_index,
327 IN VldbListByAttributes *attributes,
328 OUT afs_int32 *nentries,
329 OUT bulkentries *blkentries
330 ) = VLLISTATTRIBUTES;
333 IN VldbListByAttributes *attributes,
334 OUT afs_int32 *nentries,
335 OUT vldb_list *linkedentries
340 vital_vlheader *vital_header
346 OUT VLCallBack *spare3,
347 OUT afs_int32 *nentries,
348 OUT bulkaddrs *blkaddrs
358 IN nvldbentry *newentry
364 OUT nvldbentry *entry
370 nvldbentry *newentry,
371 afs_int32 ReleaseType
375 IN afs_int32 previous_index,
376 OUT afs_int32 *count,
377 afs_int32 *next_index,
382 IN VldbListByAttributes *attributes,
383 OUT afs_int32 *nentries,
384 OUT nbulkentries *blkentries
385 ) = VLLISTATTRIBUTESN;
388 IN VldbListByAttributes *attributes,
389 OUT afs_int32 *nentries,
390 OUT nvldb_list *linkedentries
394 IN string volumename<VL_MAXNAMELEN>,
395 VldbUpdateEntry *UpdateEntry,
396 afs_int32 ReleaseType
397 ) = VLUPDATEENTRYBYNAME;
406 IN VldbListByAttributes *attributes,
407 IN string volumename<VL_MAXNAMELEN>,
408 IN afs_int32 startindex,
409 OUT afs_int32 *nentries,
410 OUT nbulkentries *blkentries,
411 OUT afs_int32 *nextstartindex
412 ) = VLLISTATTRIBUTESN2;
414 %#endif /* !defined(KERNEL) */