inode_vxfs(F)
inode (vxfs) - format of a VERITAS File System inode
Synopsis
#include <sys/types.h>
#include <sys/fs/vx_inode.h>
Description
Although a vxfs inode is typically 256 bytes in
length, an inode size of 512 bytes can be used instead. The inode size
can be set when the file system is made
(see mkfs_vxfs(ADM)).
An inode entry has the following format:
- i_mode
- The mode and type of file.
- i_nlink
- The number of links to the file.
- i_uid
- The inode owner.
- i_gid
- The inode group.
- i_size
- The size in bytes of the file. Eight bytes have been allocated. Only four bytes are used in the current
implementation.
- i_atime
- Time of last access, in timestruc_t format.
- i_mtime
- Time of last modification, in timestruc_t format.
- i_ctime
- Time of last inode change, in timestruc_t format.
- i_aflags
- These flags are used to control the allocation and extension of files.
- VX_AF_IBAD
- If this flag is set, the inode is invalid in some way. It should be cleared when fsck is run
(see fsck_vxfs(ADM)).
- VX_AF_NOEXTEND
- If this flag is set, the file may not be extended once the current reservation is exceeded. The
reservation may be increased by the VX_SETEXT ioctl, but the file will not be
automatically extended.
- VX_AF_NOGROW
- If this flag is set, the file may not be extended once the current
reservation is exceeded. It should be cleared on truncation or when
setext(C)
is run. This flag is usually set because an
I/O error occurs while extending a file.
- VX_AF_ALIGN
- If this flag is set, the file must be allocated in extents of a fixed size and alignment. If an
extent of i_fixextsize blocks aligned on an i_fixextsize boundary can't be found,
then the allocation will fail. The alignment is relative to the beginning of the
allocation unit.
- i_orgtype
- Mapping type. Indicates how the inode mapping area is to be interpreted. Currently there are two
mapping types supported:
- IORG_NONE
- Mapping area is unused. IORG_NONE is used for files that have no associated data
storage. Since there is no need for either extents or immediate data, the mapping
area is unused. Block and character special files are an example of files that use
the IORG_NONE organization type.
- IORG_EXT4
- Mapping area consists of an array of 32-bit extent block addresses and sizes.
- IORG_IMMED
- Mapping area itself is a data block. This mapping is referred to as Immediate Inode Data.
- IORG_TYPED
- Mapping area consists of type-extent structures.
- i_eopflags
- Extended inode operation flag area.
- i_eopdata
- Extended inode operation data area.
- i_ftarea
- This is a union. The contents are determined by file type.
-
- For devices, the following field is supported:
- i_rdev
- The device number of a block or character special device.
- For directories, the following field is supported:
- i_dotdot
- The parent directory inode inumber if the inode is a directory. This replaces the standard
``..'' entry in the first directory block. The vxfs file system does not have explicit
``.'' and ``..'' entries.
- For regular files, the following fields are supported:
- i_reserve
- The number of data blocks reserved for exclusive use by the file
(preallocation). A preallocation may be requested using ioctl.
See
vxfsio(HW).
- i_fixextsize
- Set when the inode has a fixed extent size. The default is to have
a variable extent size allocation policy. A fixed extent size may be
specified using ioctl.
See
vxfsio(HW).
- For structural files, the following fields are supported:
- i_matchino
- (Version 2 layout and later only.) The inode number of the ``matching'' inode. For
replicated files, this is the inode of the replica. For extent map reorganization files,
this is the inode of the file being reorganized.
- i_fsetindex
- (Version 2 layout and later only.) The index of the fileset associated with this inode.
- i_blocks
- The number of blocks currently allocated to the file, including any blocks allocated for indirect
address extents.
- i_gen
- The generation number. A serial number which is incremented whenever the inode is freed and
reallocated. It is designed to provide a ``handle'' for stateless servers such as NFS.
- i_vversion
- A count of the number of times the inode metadata has been modified. This field is a 64-bit number.
- ic_org
- The mapping area. This field is a union based on the value of i_orgtype and the file system type.
- For the vxfs IORG_IMMED organization type, the following structure is used:
- i_immed
- The immediate inode data area, NIMMED_N (currently 96) bytes in length (see
fs_immedlen). Any directory or symbolic link which is <= 96 bytes in length will
be stored directly in the inode.
- For the vxfs IORG_EXT4 organization type, the following structure is used:
- i_spare
- Four bytes of padding, not used.
- i_ies
- Indirect extent size. This is the size in blocks of the indirect data extents in the file.
- i_ie
- Array of indirect address extents. There are NIADDR indirect address extents. The indirect
address extents are 8192 bytes long. Each indirect address extent may contain up
to 2048 extent addresses.
- The first indirect address extent is used for single indirection. With single indirection, each
entry in the indirect address extent indicates the starting block number of a data
extent.
- The second indirect address extent is a double indirect address extent. With double
indirection, each entry in the indirect address extent indicates the starting block
number of a single indirect address extent.
- i_dext
- An array of structures containing the direct extent addresses and sizes. Up to NDADDR_N
direct extents are supported. Since a variable length extent allocation policy is
used, each direct extent may have a different size. Each structure contains the
following elements:
- i_de Direct extent address.
- i_des Direct extent size.
For the IORG_TYPED organization type, the following structure is used:
- reserved
- (Version 1 layout only.) Bytes 176 to the end of the inode are empty and reserved.
- i_iattrino
- (Version 2 layout and later only.) Indirect attribute inode. This identifies the inode in the attribute
fileset that contains indirect attribute references.
- The remaining bytes of the inode are reserved for extended attribute records, which are formatted as
follows:
- length
- The exact length of the attribute record. If this is not a multiple of 4 bytes, the start of the
next attribute record is found by rounding the length up to a 4 byte boundary.
- format
- The format of the data layout of the remainder of the attribute record. Each attribute
consists of a class identifying the attribute's administrative domain; a subclass
identifying the attribute within the administrative domain; and data. The valid
record formats are:
- ATTR_EXTIMMED
- This record extends the immediate data area so that files larger than 96 bytes can be stored directly in the inode.
- ATTR_IMMED
- The attribute is stored directly in the inode. The fields in the rest of this record are:
- class
- The class of the attribute.
- subclass
- The subclass of the attribute.
- data
- The attribute data.
- ATTR_DIRECT
- When attributes are too large to store directly in the inode, each attribute is stored in its own file. This record lists each attribute along with the inode number corresponding to the file in which the attribute is stored. The number of entries in the list is determined by the length of the record. The fields in each entry are:
- class
- The class of the attribute.
- subclass
- The subclass of the attribute.
- length
- The length of the attribute data. This allows attribute operations to check
the length of an attribute without reading the attribute inode.
- inumber
- The inode number of the file containing the attribute data. The inode is
part of the attribute fileset.
The attribute records in the inode are terminated by a record with a format of zero (for compatibility with file systems that have the last 80 bytes of all inodes set to NULL).
References
setext(C),
fsck_vxfs(ADM),
mkfs_vxfs(ADM),
stat(S),
fs_vxfs(F),
types(M)
vxfsio(HW)
© 1997 The Santa Cruz Operation, Inc. All rights reserved.