2 * Copyright 2000, International Business Machines Corporation and others.
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
13 Institution: The Information Technology Center, Carnegie-Mellon University
17 #ifndef __volinodes_h_
18 #define __volinodes_h_
22 /* Used by vutil.c and salvager.c */
25 #define NO_LINK_TABLE 0
27 #define NO_LINK_TABLE 1
30 #define MAXINODETYPE VI_LINKTABLE
31 static struct afs_inode_info {
32 struct versionStamp stamp;
34 int size; /* size of any fixed size portion of the header */
37 /* if this is 1, then this inode is obsolete--
38 * salvager may delete it, and shouldn't complain
39 * if it isn't there; create can not bother to create it */
41 } afs_common_inode_info[MAXINODETYPE] = {
43 {VOLUMEINFOMAGIC, VOLUMEINFOVERSION},
45 sizeof(VolumeDiskData),
46 (Inode*)offsetof(struct VolumeHeader, volumeInfo),
51 {SMALLINDEXMAGIC, SMALLINDEXVERSION},
53 sizeof(struct versionStamp),
54 (Inode*)offsetof(struct VolumeHeader, smallVnodeIndex),
59 {LARGEINDEXMAGIC, LARGEINDEXVERSION},
61 sizeof(struct versionStamp),
62 (Inode*)offsetof(struct VolumeHeader, largeVnodeIndex),
67 {ACLMAGIC, ACLVERSION},
69 sizeof(struct versionStamp),
70 (Inode*)offsetof(struct VolumeHeader, volumeAcl),
71 "access control list",
75 {MOUNTMAGIC, MOUNTVERSION},
77 sizeof(struct versionStamp),
78 (Inode*)offsetof(struct VolumeHeader, volumeMountTable),
83 {LINKTABLEMAGIC, LINKTABLEVERSION},
85 sizeof(struct versionStamp),
86 (Inode*)offsetof(struct VolumeHeader, linkTable),
91 /* inodeType is redundant in the above table; it used to be useful, but now
92 we require the table to be ordered */
95 * initialize a struct afs_inode_info
97 * @param[in] header the volume header struct to use when referencing volume
98 * header fields in 'stuff'
99 * @param[out] stuff the struct afs_inode_info to initialize
103 init_inode_info(struct VolumeHeader *header,
104 struct afs_inode_info *stuff)
107 memcpy(stuff, afs_common_inode_info, sizeof(afs_common_inode_info));
108 for (i = 0; i < MAXINODETYPE; i++) {
109 stuff[i].inode = (Inode*)((char*)header + (uintptr_t)stuff[i].inode);
113 #endif /* __volinodes_h_ */