Reconciliation of src/{afs,vol}/voldefs.h
[openafs.git] / src / vol / voldefs.h
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 /*
11  * System:              VICE-TWO
12  * Module:              voldefs.h
13  * Institution: The Information Technology Center, Carnegie-Mellon University
14  */
15
16 /* If you add volume types here, be sure to check the definition of
17  * volumeWriteable in volume.h
18  */
19
20 #define readwriteVolume         RWVOL
21 #define readonlyVolume          ROVOL
22 #define backupVolume            BACKVOL
23 #define rwreplicaVolume         RWREPL
24
25 #define RWVOL                   0
26 #define ROVOL                   1
27 #define BACKVOL                 2
28 #define RWREPL                  3
29
30 #define VOLMAXTYPES             4   /* current max number of types */
31
32 /* the maximum number of volumes in a volume group that we can handle */
33
34 #define VOL_VG_MAX_VOLS 20
35
36 /* How many times to retry if we raced the fileserver restarting, when trying
37  * to check out or lock a volume. */
38
39 #define VOL_MAX_CHECKOUT_RETRIES 10
40
41 /* maximum number of vice partitions */
42 #define VOLMAXPARTS     255
43
44 #define VFORMATDIGITS 10
45
46 /*
47  * All volumes will have a volume header file with the filename
48  * in one of these two formats. The difference is largely historical.
49  * Early versions of System V Unix had severe limitations on maximum
50  * filename length, and the '.vol' extension had to be shortened to
51  * allow for the maximum volume name to fit. Those restrictions no
52  * longer apply, but the descendants of those legacy AIX and HPUX
53  * servers still use the shorter name.
54  *
55  * If you change VHDREXT, you must change VFORMAT as well. Don't try
56  * this with token pasting in cpp; it's just too inconsistent in
57  * across C compilers.
58  *
59  * Note that <afs/param.h> must have been included before we get here.
60  */
61
62 #if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV)
63 #define VHDREXT ".vl"
64 #define VFORMAT "V%010" AFS_VOLID_FMT ".vl"
65 #else
66 #define VHDREXT ".vol"
67 #define VFORMAT "V%010" AFS_VOLID_FMT ".vol"
68 #endif
69 #define VHDRNAMELEN (VFORMATDIGITS + 1 + sizeof(VHDREXT) - 1) /* must match VFORMAT */
70
71 /* Maximum length (including trailing NUL) of a volume external path name. */
72 #define VMAXPATHLEN 64
73
74 #if defined(AFS_NAMEI_ENV) && !defined(AFS_NT40_ENV)
75
76 /* INODEDIR holds all the inodes. Since it's name does not begin with "V"
77  * and it's created when the first volume is created, linear directory
78  * searches will find the directory early. If only I had needed this before
79  * the NT server went beta, it could be used there as well.
80  */
81
82 #define INODEDIR "AFSIDat"
83 #define INODEDIRLEN (sizeof(INODEDIR)-1)
84 #endif
85
86 /* Pathname for the maximum volume id ever created by this server */
87
88 #define MAXVOLIDPATH    "/vice/vol/maxvolid"
89
90 /* Pathname for server id definitions. The server id is used to
91  * allocate volume numbers. */
92
93 #define SERVERLISTPATH  "/vice/db/servers"