18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright (c) 2000-2001 Christoph Hellwig. 38c2ecf20Sopenharmony_ci * All rights reserved. 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Redistribution and use in source and binary forms, with or without 68c2ecf20Sopenharmony_ci * modification, are permitted provided that the following conditions 78c2ecf20Sopenharmony_ci * are met: 88c2ecf20Sopenharmony_ci * 1. Redistributions of source code must retain the above copyright 98c2ecf20Sopenharmony_ci * notice, this list of conditions, and the following disclaimer, 108c2ecf20Sopenharmony_ci * without modification. 118c2ecf20Sopenharmony_ci * 2. The name of the author may not be used to endorse or promote products 128c2ecf20Sopenharmony_ci * derived from this software without specific prior written permission. 138c2ecf20Sopenharmony_ci * 148c2ecf20Sopenharmony_ci * Alternatively, this software may be distributed under the terms of the 158c2ecf20Sopenharmony_ci * GNU General Public License ("GPL"). 168c2ecf20Sopenharmony_ci * 178c2ecf20Sopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 188c2ecf20Sopenharmony_ci * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 198c2ecf20Sopenharmony_ci * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 208c2ecf20Sopenharmony_ci * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 218c2ecf20Sopenharmony_ci * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 228c2ecf20Sopenharmony_ci * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 238c2ecf20Sopenharmony_ci * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 248c2ecf20Sopenharmony_ci * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 258c2ecf20Sopenharmony_ci * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 268c2ecf20Sopenharmony_ci * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 278c2ecf20Sopenharmony_ci * SUCH DAMAGE. 288c2ecf20Sopenharmony_ci * 298c2ecf20Sopenharmony_ci */ 308c2ecf20Sopenharmony_ci#ifndef _VXFS_OLT_H_ 318c2ecf20Sopenharmony_ci#define _VXFS_OLT_H_ 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci/* 348c2ecf20Sopenharmony_ci * Veritas filesystem driver - Object Location Table data structures. 358c2ecf20Sopenharmony_ci * 368c2ecf20Sopenharmony_ci * This file contains definitions for the Object Location Table used 378c2ecf20Sopenharmony_ci * by the Veritas Filesystem version 2 and newer. 388c2ecf20Sopenharmony_ci */ 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci/* 428c2ecf20Sopenharmony_ci * OLT magic number (vxfs_olt->olt_magic). 438c2ecf20Sopenharmony_ci */ 448c2ecf20Sopenharmony_ci#define VXFS_OLT_MAGIC 0xa504FCF5 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci/* 478c2ecf20Sopenharmony_ci * VxFS OLT entry types. 488c2ecf20Sopenharmony_ci */ 498c2ecf20Sopenharmony_cienum { 508c2ecf20Sopenharmony_ci VXFS_OLT_FREE = 1, 518c2ecf20Sopenharmony_ci VXFS_OLT_FSHEAD = 2, 528c2ecf20Sopenharmony_ci VXFS_OLT_CUT = 3, 538c2ecf20Sopenharmony_ci VXFS_OLT_ILIST = 4, 548c2ecf20Sopenharmony_ci VXFS_OLT_DEV = 5, 558c2ecf20Sopenharmony_ci VXFS_OLT_SB = 6 568c2ecf20Sopenharmony_ci}; 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci/* 598c2ecf20Sopenharmony_ci * VxFS OLT header. 608c2ecf20Sopenharmony_ci * 618c2ecf20Sopenharmony_ci * The Object Location Table header is placed at the beginning of each 628c2ecf20Sopenharmony_ci * OLT extent. It is used to fing certain filesystem-wide metadata, e.g. 638c2ecf20Sopenharmony_ci * the initial inode list, the fileset header or the device configuration. 648c2ecf20Sopenharmony_ci */ 658c2ecf20Sopenharmony_cistruct vxfs_olt { 668c2ecf20Sopenharmony_ci __fs32 olt_magic; /* magic number */ 678c2ecf20Sopenharmony_ci __fs32 olt_size; /* size of this entry */ 688c2ecf20Sopenharmony_ci __fs32 olt_checksum; /* checksum of extent */ 698c2ecf20Sopenharmony_ci __u32 __unused1; /* ??? */ 708c2ecf20Sopenharmony_ci __fs32 olt_mtime; /* time of last mod. (sec) */ 718c2ecf20Sopenharmony_ci __fs32 olt_mutime; /* time of last mod. (usec) */ 728c2ecf20Sopenharmony_ci __fs32 olt_totfree; /* free space in OLT extent */ 738c2ecf20Sopenharmony_ci __fs32 olt_extents[2]; /* addr of this extent, replica */ 748c2ecf20Sopenharmony_ci __fs32 olt_esize; /* size of this extent */ 758c2ecf20Sopenharmony_ci __fs32 olt_next[2]; /* addr of next extent, replica */ 768c2ecf20Sopenharmony_ci __fs32 olt_nsize; /* size of next extent */ 778c2ecf20Sopenharmony_ci __u32 __unused2; /* align to 8 byte boundary */ 788c2ecf20Sopenharmony_ci}; 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci/* 818c2ecf20Sopenharmony_ci * VxFS common OLT entry (on disk). 828c2ecf20Sopenharmony_ci */ 838c2ecf20Sopenharmony_cistruct vxfs_oltcommon { 848c2ecf20Sopenharmony_ci __fs32 olt_type; /* type of this record */ 858c2ecf20Sopenharmony_ci __fs32 olt_size; /* size of this record */ 868c2ecf20Sopenharmony_ci}; 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_ci/* 898c2ecf20Sopenharmony_ci * VxFS free OLT entry (on disk). 908c2ecf20Sopenharmony_ci */ 918c2ecf20Sopenharmony_cistruct vxfs_oltfree { 928c2ecf20Sopenharmony_ci __fs32 olt_type; /* type of this record */ 938c2ecf20Sopenharmony_ci __fs32 olt_fsize; /* size of this free record */ 948c2ecf20Sopenharmony_ci}; 958c2ecf20Sopenharmony_ci 968c2ecf20Sopenharmony_ci/* 978c2ecf20Sopenharmony_ci * VxFS initial-inode list (on disk). 988c2ecf20Sopenharmony_ci */ 998c2ecf20Sopenharmony_cistruct vxfs_oltilist { 1008c2ecf20Sopenharmony_ci __fs32 olt_type; /* type of this record */ 1018c2ecf20Sopenharmony_ci __fs32 olt_size; /* size of this record */ 1028c2ecf20Sopenharmony_ci __fs32 olt_iext[2]; /* initial inode list, replica */ 1038c2ecf20Sopenharmony_ci}; 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci/* 1068c2ecf20Sopenharmony_ci * Current Usage Table 1078c2ecf20Sopenharmony_ci */ 1088c2ecf20Sopenharmony_cistruct vxfs_oltcut { 1098c2ecf20Sopenharmony_ci __fs32 olt_type; /* type of this record */ 1108c2ecf20Sopenharmony_ci __fs32 olt_size; /* size of this record */ 1118c2ecf20Sopenharmony_ci __fs32 olt_cutino; /* inode of current usage table */ 1128c2ecf20Sopenharmony_ci __u8 __pad; /* unused, 8 byte align */ 1138c2ecf20Sopenharmony_ci}; 1148c2ecf20Sopenharmony_ci 1158c2ecf20Sopenharmony_ci/* 1168c2ecf20Sopenharmony_ci * Inodes containing Superblock, Intent log and OLTs 1178c2ecf20Sopenharmony_ci */ 1188c2ecf20Sopenharmony_cistruct vxfs_oltsb { 1198c2ecf20Sopenharmony_ci __fs32 olt_type; /* type of this record */ 1208c2ecf20Sopenharmony_ci __fs32 olt_size; /* size of this record */ 1218c2ecf20Sopenharmony_ci __fs32 olt_sbino; /* inode of superblock file */ 1228c2ecf20Sopenharmony_ci __u32 __unused1; /* ??? */ 1238c2ecf20Sopenharmony_ci __fs32 olt_logino[2]; /* inode of log file,replica */ 1248c2ecf20Sopenharmony_ci __fs32 olt_oltino[2]; /* inode of OLT, replica */ 1258c2ecf20Sopenharmony_ci}; 1268c2ecf20Sopenharmony_ci 1278c2ecf20Sopenharmony_ci/* 1288c2ecf20Sopenharmony_ci * Inode containing device configuration + it's replica 1298c2ecf20Sopenharmony_ci */ 1308c2ecf20Sopenharmony_cistruct vxfs_oltdev { 1318c2ecf20Sopenharmony_ci __fs32 olt_type; /* type of this record */ 1328c2ecf20Sopenharmony_ci __fs32 olt_size; /* size of this record */ 1338c2ecf20Sopenharmony_ci __fs32 olt_devino[2]; /* inode of device config files */ 1348c2ecf20Sopenharmony_ci}; 1358c2ecf20Sopenharmony_ci 1368c2ecf20Sopenharmony_ci/* 1378c2ecf20Sopenharmony_ci * Fileset header 1388c2ecf20Sopenharmony_ci */ 1398c2ecf20Sopenharmony_cistruct vxfs_oltfshead { 1408c2ecf20Sopenharmony_ci __fs32 olt_type; /* type number */ 1418c2ecf20Sopenharmony_ci __fs32 olt_size; /* size of this record */ 1428c2ecf20Sopenharmony_ci __fs32 olt_fsino[2]; /* inodes of fileset header */ 1438c2ecf20Sopenharmony_ci}; 1448c2ecf20Sopenharmony_ci 1458c2ecf20Sopenharmony_ci#endif /* _VXFS_OLT_H_ */ 146