vxfs_olt.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. /*
  33. * Veritas filesystem driver - Object Location Table data structures.
  34. *
  35. * This file contains definitions for the Object Location Table used
  36. * by the Veritas Filesystem version 2 and newer.
  37. */
  38. /*
  39. * OLT magic number (vxfs_olt->olt_magic).
  40. */
  41. #define VXFS_OLT_MAGIC 0xa504FCF5
  42. /*
  43. * VxFS OLT entry types.
  44. */
  45. enum {
  46. VXFS_OLT_FREE = 1,
  47. VXFS_OLT_FSHEAD = 2,
  48. VXFS_OLT_CUT = 3,
  49. VXFS_OLT_ILIST = 4,
  50. VXFS_OLT_DEV = 5,
  51. VXFS_OLT_SB = 6
  52. };
  53. /*
  54. * VxFS OLT header.
  55. *
  56. * The Object Location Table header is placed at the beginning of each
  57. * OLT extent. It is used to fing certain filesystem-wide metadata, e.g.
  58. * the initial inode list, the fileset header or the device configuration.
  59. */
  60. struct vxfs_olt {
  61. __fs32 olt_magic; /* magic number */
  62. __fs32 olt_size; /* size of this entry */
  63. __fs32 olt_checksum; /* checksum of extent */
  64. __u32 __unused1; /* ??? */
  65. __fs32 olt_mtime; /* time of last mod. (sec) */
  66. __fs32 olt_mutime; /* time of last mod. (usec) */
  67. __fs32 olt_totfree; /* free space in OLT extent */
  68. __fs32 olt_extents[2]; /* addr of this extent, replica */
  69. __fs32 olt_esize; /* size of this extent */
  70. __fs32 olt_next[2]; /* addr of next extent, replica */
  71. __fs32 olt_nsize; /* size of next extent */
  72. __u32 __unused2; /* align to 8 byte boundary */
  73. };
  74. /*
  75. * VxFS common OLT entry (on disk).
  76. */
  77. struct vxfs_oltcommon {
  78. __fs32 olt_type; /* type of this record */
  79. __fs32 olt_size; /* size of this record */
  80. };
  81. /*
  82. * VxFS free OLT entry (on disk).
  83. */
  84. struct vxfs_oltfree {
  85. __fs32 olt_type; /* type of this record */
  86. __fs32 olt_fsize; /* size of this free record */
  87. };
  88. /*
  89. * VxFS initial-inode list (on disk).
  90. */
  91. struct vxfs_oltilist {
  92. __fs32 olt_type; /* type of this record */
  93. __fs32 olt_size; /* size of this record */
  94. __fs32 olt_iext[2]; /* initial inode list, replica */
  95. };
  96. /*
  97. * Current Usage Table
  98. */
  99. struct vxfs_oltcut {
  100. __fs32 olt_type; /* type of this record */
  101. __fs32 olt_size; /* size of this record */
  102. __fs32 olt_cutino; /* inode of current usage table */
  103. __u8 __pad; /* unused, 8 byte align */
  104. };
  105. /*
  106. * Inodes containing Superblock, Intent log and OLTs
  107. */
  108. struct vxfs_oltsb {
  109. __fs32 olt_type; /* type of this record */
  110. __fs32 olt_size; /* size of this record */
  111. __fs32 olt_sbino; /* inode of superblock file */
  112. __u32 __unused1; /* ??? */
  113. __fs32 olt_logino[2]; /* inode of log file,replica */
  114. __fs32 olt_oltino[2]; /* inode of OLT, replica */
  115. };
  116. /*
  117. * Inode containing device configuration + it's replica
  118. */
  119. struct vxfs_oltdev {
  120. __fs32 olt_type; /* type of this record */
  121. __fs32 olt_size; /* size of this record */
  122. __fs32 olt_devino[2]; /* inode of device config files */
  123. };
  124. /*
  125. * Fileset header
  126. */
  127. struct vxfs_oltfshead {
  128. __fs32 olt_type; /* type number */
  129. __fs32 olt_size; /* size of this record */
  130. __fs32 olt_fsino[2]; /* inodes of fileset header */
  131. };
  132. #endif /* _VXFS_OLT_H_ */