xref: /OK3568_Linux_fs/kernel/fs/freevxfs/vxfs_olt.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright (c) 2000-2001 Christoph Hellwig.
3*4882a593Smuzhiyun  * All rights reserved.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Redistribution and use in source and binary forms, with or without
6*4882a593Smuzhiyun  * modification, are permitted provided that the following conditions
7*4882a593Smuzhiyun  * are met:
8*4882a593Smuzhiyun  * 1. Redistributions of source code must retain the above copyright
9*4882a593Smuzhiyun  *    notice, this list of conditions, and the following disclaimer,
10*4882a593Smuzhiyun  *    without modification.
11*4882a593Smuzhiyun  * 2. The name of the author may not be used to endorse or promote products
12*4882a593Smuzhiyun  *    derived from this software without specific prior written permission.
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  * Alternatively, this software may be distributed under the terms of the
15*4882a593Smuzhiyun  * GNU General Public License ("GPL").
16*4882a593Smuzhiyun  *
17*4882a593Smuzhiyun  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18*4882a593Smuzhiyun  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19*4882a593Smuzhiyun  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20*4882a593Smuzhiyun  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
21*4882a593Smuzhiyun  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*4882a593Smuzhiyun  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23*4882a593Smuzhiyun  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24*4882a593Smuzhiyun  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25*4882a593Smuzhiyun  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26*4882a593Smuzhiyun  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27*4882a593Smuzhiyun  * SUCH DAMAGE.
28*4882a593Smuzhiyun  *
29*4882a593Smuzhiyun  */
30*4882a593Smuzhiyun #ifndef _VXFS_OLT_H_
31*4882a593Smuzhiyun #define _VXFS_OLT_H_
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun /*
34*4882a593Smuzhiyun  * Veritas filesystem driver - Object Location Table data structures.
35*4882a593Smuzhiyun  *
36*4882a593Smuzhiyun  * This file contains definitions for the Object Location Table used
37*4882a593Smuzhiyun  * by the Veritas Filesystem version 2 and newer.
38*4882a593Smuzhiyun  */
39*4882a593Smuzhiyun 
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun /*
42*4882a593Smuzhiyun  * OLT magic number (vxfs_olt->olt_magic).
43*4882a593Smuzhiyun  */
44*4882a593Smuzhiyun #define VXFS_OLT_MAGIC		0xa504FCF5
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun /*
47*4882a593Smuzhiyun  * VxFS OLT entry types.
48*4882a593Smuzhiyun  */
49*4882a593Smuzhiyun enum {
50*4882a593Smuzhiyun 	VXFS_OLT_FREE	= 1,
51*4882a593Smuzhiyun 	VXFS_OLT_FSHEAD	= 2,
52*4882a593Smuzhiyun 	VXFS_OLT_CUT	= 3,
53*4882a593Smuzhiyun 	VXFS_OLT_ILIST	= 4,
54*4882a593Smuzhiyun 	VXFS_OLT_DEV	= 5,
55*4882a593Smuzhiyun 	VXFS_OLT_SB	= 6
56*4882a593Smuzhiyun };
57*4882a593Smuzhiyun 
58*4882a593Smuzhiyun /*
59*4882a593Smuzhiyun  * VxFS OLT header.
60*4882a593Smuzhiyun  *
61*4882a593Smuzhiyun  * The Object Location Table header is placed at the beginning of each
62*4882a593Smuzhiyun  * OLT extent.  It is used to fing certain filesystem-wide metadata, e.g.
63*4882a593Smuzhiyun  * the initial inode list, the fileset header or the device configuration.
64*4882a593Smuzhiyun  */
65*4882a593Smuzhiyun struct vxfs_olt {
66*4882a593Smuzhiyun 	__fs32		olt_magic;	/* magic number			*/
67*4882a593Smuzhiyun 	__fs32		olt_size;	/* size of this entry		*/
68*4882a593Smuzhiyun 	__fs32		olt_checksum;	/* checksum of extent		*/
69*4882a593Smuzhiyun 	__u32		__unused1;	/* ???				*/
70*4882a593Smuzhiyun 	__fs32		olt_mtime;	/* time of last mod. (sec)	*/
71*4882a593Smuzhiyun 	__fs32		olt_mutime;	/* time of last mod. (usec)	*/
72*4882a593Smuzhiyun 	__fs32		olt_totfree;	/* free space in OLT extent	*/
73*4882a593Smuzhiyun 	__fs32		olt_extents[2];	/* addr of this extent, replica	*/
74*4882a593Smuzhiyun 	__fs32		olt_esize;	/* size of this extent		*/
75*4882a593Smuzhiyun 	__fs32		olt_next[2];    /* addr of next extent, replica	*/
76*4882a593Smuzhiyun 	__fs32		olt_nsize;	/* size of next extent		*/
77*4882a593Smuzhiyun 	__u32		__unused2;	/* align to 8 byte boundary	*/
78*4882a593Smuzhiyun };
79*4882a593Smuzhiyun 
80*4882a593Smuzhiyun /*
81*4882a593Smuzhiyun  * VxFS common OLT entry (on disk).
82*4882a593Smuzhiyun  */
83*4882a593Smuzhiyun struct vxfs_oltcommon {
84*4882a593Smuzhiyun 	__fs32		olt_type;	/* type of this record		*/
85*4882a593Smuzhiyun 	__fs32		olt_size;	/* size of this record		*/
86*4882a593Smuzhiyun };
87*4882a593Smuzhiyun 
88*4882a593Smuzhiyun /*
89*4882a593Smuzhiyun  * VxFS free OLT entry (on disk).
90*4882a593Smuzhiyun  */
91*4882a593Smuzhiyun struct vxfs_oltfree {
92*4882a593Smuzhiyun 	__fs32		olt_type;	/* type of this record		*/
93*4882a593Smuzhiyun 	__fs32		olt_fsize;	/* size of this free record	*/
94*4882a593Smuzhiyun };
95*4882a593Smuzhiyun 
96*4882a593Smuzhiyun /*
97*4882a593Smuzhiyun  * VxFS initial-inode list (on disk).
98*4882a593Smuzhiyun  */
99*4882a593Smuzhiyun struct vxfs_oltilist {
100*4882a593Smuzhiyun 	__fs32	olt_type;	/* type of this record		*/
101*4882a593Smuzhiyun 	__fs32	olt_size;	/* size of this record		*/
102*4882a593Smuzhiyun 	__fs32		olt_iext[2];	/* initial inode list, replica	*/
103*4882a593Smuzhiyun };
104*4882a593Smuzhiyun 
105*4882a593Smuzhiyun /*
106*4882a593Smuzhiyun  * Current Usage Table
107*4882a593Smuzhiyun  */
108*4882a593Smuzhiyun struct vxfs_oltcut {
109*4882a593Smuzhiyun 	__fs32		olt_type;	/* type of this record		*/
110*4882a593Smuzhiyun 	__fs32		olt_size;	/* size of this record		*/
111*4882a593Smuzhiyun 	__fs32		olt_cutino;	/* inode of current usage table	*/
112*4882a593Smuzhiyun 	__u8		__pad;		/* unused, 8 byte align		*/
113*4882a593Smuzhiyun };
114*4882a593Smuzhiyun 
115*4882a593Smuzhiyun /*
116*4882a593Smuzhiyun  * Inodes containing Superblock, Intent log and OLTs
117*4882a593Smuzhiyun  */
118*4882a593Smuzhiyun struct vxfs_oltsb {
119*4882a593Smuzhiyun 	__fs32		olt_type;	/* type of this record		*/
120*4882a593Smuzhiyun 	__fs32		olt_size;	/* size of this record		*/
121*4882a593Smuzhiyun 	__fs32		olt_sbino;	/* inode of superblock file	*/
122*4882a593Smuzhiyun 	__u32		__unused1;	/* ???				*/
123*4882a593Smuzhiyun 	__fs32		olt_logino[2];	/* inode of log file,replica	*/
124*4882a593Smuzhiyun 	__fs32		olt_oltino[2];	/* inode of OLT, replica	*/
125*4882a593Smuzhiyun };
126*4882a593Smuzhiyun 
127*4882a593Smuzhiyun /*
128*4882a593Smuzhiyun  * Inode containing device configuration + it's replica
129*4882a593Smuzhiyun  */
130*4882a593Smuzhiyun struct vxfs_oltdev {
131*4882a593Smuzhiyun 	__fs32		olt_type;	/* type of this record		*/
132*4882a593Smuzhiyun 	__fs32		olt_size;	/* size of this record		*/
133*4882a593Smuzhiyun 	__fs32		olt_devino[2];	/* inode of device config files	*/
134*4882a593Smuzhiyun };
135*4882a593Smuzhiyun 
136*4882a593Smuzhiyun /*
137*4882a593Smuzhiyun  * Fileset header
138*4882a593Smuzhiyun  */
139*4882a593Smuzhiyun struct vxfs_oltfshead {
140*4882a593Smuzhiyun 	__fs32		olt_type;	/* type number			*/
141*4882a593Smuzhiyun 	__fs32		olt_size;	/* size of this record		*/
142*4882a593Smuzhiyun 	__fs32		olt_fsino[2];   /* inodes of fileset header	*/
143*4882a593Smuzhiyun };
144*4882a593Smuzhiyun 
145*4882a593Smuzhiyun #endif /* _VXFS_OLT_H_ */
146