vxfs_olt.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:4k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

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