Coda Distributed File System
vldb.h
Go to the documentation of this file.
1/* BLURB gpl
2
3 Coda File System
4 Release 6
5
6 Copyright (c) 1987-2016 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU General Public Licence Version 2, as shown in the
11file LICENSE. The technical and financial contributors to Coda are
12listed in the file CREDITS.
13
14 Additional copyrights
15
16#*/
17
18/*
19 IBM COPYRIGHT NOTICE
20
21 Copyright (C) 1986
22 International Business Machines Corporation
23 All Rights Reserved
24
25This file contains some code identical to or derived from the 1986
26version of the Andrew File System ("AFS"), which is owned by the IBM
27Corporation. This code is provided "AS IS" and IBM does not warrant
28that it is free of infringement of any intellectual rights of any
29third party. IBM disclaims liability of any kind for any damages
30whatsoever resulting directly or indirectly from use of this software
31or of any derivative work. Carnegie Mellon University has obtained
32permission to modify, distribute and sublicense this code, which is
33based on Version 2 of AFS and does not contain the features and
34enhancements that are part of Version 3 of AFS. Version 3 of AFS is
35commercially available and supported by Transarc Corporation,
36Pittsburgh, PA.
37
38*/
39
40#ifndef _VLDB_H_
41#define _VLDB_H_ 1
42
43#ifdef HAVE_STDINT_H
44#include <stdint.h>
45#else
46typedef unsigned int uint32_t;
47#endif
48
49/* Note: this structure happens to be 64 bytes long which isn't real important.
50 * But it seemed like a nice number, and the code currently does use a shift. */
51
52#define MAXVOLTYPES \
53 5 /* Maximum number of different types of
54 volumes, each of which can be associated
55 with the current volume */
56/* (defined in vcrcommon.rpc2) VSG_MEMBERS 8 -* Maximum number of servers
57 that can be recorded in the vldb as serving
58 a single volume */
59struct vldb {
60 char key[33]; /* Name or volume id, in ascii, null terminated
61 */
62 byte hashNext; /* Number of entries between here and next hash
63 entry for same hash. 0 is the last */
64 byte volumeType; /* Volume type, as defined in vice.h (RWVOL,
65 ROVOL, BACKVOL) */
66 byte nServers; /* Number of servers that have this volume */
67 uint32_t volumeId[MAXVOLTYPES]; /* *NETORDER* Corresponding volume of
68 each type + 2 extra unused */
69 byte serverNumber[VSG_MEMBERS]; /* Server number for each server claiming
70 to know about this volume */
71};
72
73#define LOG_VLDBSIZE 6 /* Assume the structure is 64 bytes */
74
75/* Header takes up entry #0. 0 is not a legit hash code */
77struct vldbHeader {
78 uint32_t magic; /* *NETORDER* Magic number */
80 hashSize; /* *NETORDER* Size to use for hash calculation (see HashString) */
81};
82
83#define VLDB_MAGIC 0xABCD4321
84
85#define N_SERVERIDS 256 /* Not easy to change--maximum number of servers */
86
87#include <vice_file.h>
89#define VLDB_PATH vice_config_path("db/VLDB")
90#define VLDB_TEMP vice_config_path("db/VLDB.new")
91#define BACKUPLIST_PATH vice_config_path("vol/BackupList")
92
93extern struct vldb *VLDBLookup(char *key);
94extern int VLDBPrint();
95
96#endif /* _VLDB_H_ */
unsigned int uint32_t
Definition: coda.h:105
Definition: vldb.h:75
uint32_t hashSize
Definition: vldb.h:78
uint32_t magic
Definition: vldb.h:76
Definition: vldb.h:57
byte volumeType
Definition: vldb.h:62
byte nServers
Definition: vldb.h:64
uint32_t volumeId[MAXVOLTYPES]
Definition: vldb.h:65
char key[33]
Definition: vldb.h:58
byte serverNumber[VSG_MEMBERS]
Definition: vldb.h:67
byte hashNext
Definition: vldb.h:60
#define MAXVOLTYPES
Definition: vldb.h:52
unsigned int uint32_t
Definition: vldb.h:46
struct vldb * VLDBLookup(char *key)
Definition: vldb.cc:99
int VLDBPrint()
Definition: vldb.cc:152