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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *   Copyright (c) International Business Machines Corp., 2000-2002
  3.  *
  4.  *   This program is free software;  you can redistribute it and/or modify
  5.  *   it under the terms of the GNU General Public License as published by
  6.  *   the Free Software Foundation; either version 2 of the License, or 
  7.  *   (at your option) any later version.
  8.  * 
  9.  *   This program is distributed in the hope that it will be useful,
  10.  *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
  11.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
  12.  *   the GNU General Public License for more details.
  13.  *
  14.  *   You should have received a copy of the GNU General Public License
  15.  *   along with this program;  if not, write to the Free Software 
  16.  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17.  */
  18. #ifndef _H_JFS_SUPERBLOCK
  19. #define _H_JFS_SUPERBLOCK
  20. /*
  21.  * make the magic number something a human could read
  22.  */
  23. #define JFS_MAGIC  "JFS1" /* Magic word */
  24. #define JFS_VERSION 2 /* Version number: Version 2 */
  25. #define LV_NAME_SIZE 11 /* MUST BE 11 for OS/2 boot sector */
  26. /* 
  27.  * aggregate superblock 
  28.  *
  29.  * The name superblock is too close to super_block, so the name has been
  30.  * changed to jfs_superblock.  The utilities are still using the old name.
  31.  */
  32. struct jfs_superblock {
  33. char s_magic[4]; /* 4: magic number */
  34. u32 s_version; /* 4: version number */
  35. s64 s_size; /* 8: aggregate size in hardware/LVM blocks;
  36.  * VFS: number of blocks
  37.  */
  38. s32 s_bsize; /* 4: aggregate block size in bytes; 
  39.  * VFS: fragment size
  40.  */
  41. s16 s_l2bsize; /* 2: log2 of s_bsize */
  42. s16 s_l2bfactor; /* 2: log2(s_bsize/hardware block size) */
  43. s32 s_pbsize; /* 4: hardware/LVM block size in bytes */
  44. s16 s_l2pbsize; /* 2: log2 of s_pbsize */
  45. s16 pad; /* 2: padding necessary for alignment */
  46. u32 s_agsize; /* 4: allocation group size in aggr. blocks */
  47. u32 s_flag; /* 4: aggregate attributes:
  48.  *    see jfs_filsys.h
  49.  */
  50. u32 s_state; /* 4: mount/unmount/recovery state: 
  51.  *    see jfs_filsys.h
  52.  */
  53. s32 s_compress; /* 4: > 0 if data compression */
  54. pxd_t s_ait2; /* 8: first extent of secondary
  55.  *    aggregate inode table
  56.  */
  57. pxd_t s_aim2; /* 8: first extent of secondary
  58.  *    aggregate inode map
  59.  */
  60. u32 s_logdev; /* 4: device address of log */
  61. s32 s_logserial; /* 4: log serial number at aggregate mount */
  62. pxd_t s_logpxd; /* 8: inline log extent */
  63. pxd_t s_fsckpxd; /* 8: inline fsck work space extent */
  64. struct timestruc_t s_time; /* 8: time last updated */
  65. s32 s_fsckloglen; /* 4: Number of filesystem blocks reserved for
  66.  *    the fsck service log.  
  67.  *    N.B. These blocks are divided among the
  68.  *         versions kept.  This is not a per
  69.  *         version size.
  70.  *    N.B. These blocks are included in the 
  71.  *         length field of s_fsckpxd.
  72.  */
  73. s8 s_fscklog; /* 1: which fsck service log is most recent
  74.  *    0 => no service log data yet
  75.  *    1 => the first one
  76.  *    2 => the 2nd one
  77.  */
  78. char s_fpack[11]; /* 11: file system volume name 
  79.  *     N.B. This must be 11 bytes to
  80.  *          conform with the OS/2 BootSector
  81.  *          requirements
  82.  *          Only used when s_version is 1
  83.  */
  84. /* extendfs() parameter under s_state & FM_EXTENDFS */
  85. s64 s_xsize; /* 8: extendfs s_size */
  86. pxd_t s_xfsckpxd; /* 8: extendfs fsckpxd */
  87. pxd_t s_xlogpxd; /* 8: extendfs logpxd */
  88. /* - 128 byte boundary - */
  89. char s_uuid[16]; /* 16: 128-bit uuid for volume */
  90. char s_label[16]; /* 16: volume label */
  91. char s_loguuid[16]; /* 16: 128-bit uuid for log device */
  92. };
  93. extern int readSuper(struct super_block *, struct buffer_head **);
  94. extern int updateSuper(struct super_block *, uint);
  95. #endif /*_H_JFS_SUPERBLOCK */