/* xfs.h - an extraction from xfsprogs-1.3.5/include/xfs* into one file */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
* Copyright (C) 2001,2004 Free Software Foundation, Inc.
*
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
*
* For further information regarding this notice, see:
*
*/
typedef signed char xfs_int8_t;
typedef unsigned char xfs_uint8_t;
typedef short xfs_int16_t;
typedef unsigned short xfs_uint16_t;
typedef int xfs_int32_t;
typedef unsigned int xfs_uint32_t;
typedef long long xfs_int64_t;
typedef unsigned long long xfs_uint64_t;
/* those are from xfs_types.h */
/*
* Disk based types:
*/
/* those are from xfs_sb.h */
typedef struct xfs_sb
{
/* statistics */
/*
* These fields must remain contiguous. If you really
* want to change their layout, make sure you fix the
* code in xfs_trans_apply_sb_deltas().
*/
/*
* End contiguous fields.
*/
} xfs_sb_t;
/* those are from xfs_btree.h */
/*
* Long form header: bmap btrees.
*/
typedef struct xfs_btree_lblock
{
/*
* Combined header and structure, used by common code.
*/
typedef struct xfs_btree_hdr
{
typedef struct xfs_btree_block
{
union {
struct {
} s; /* short form pointers */
struct {
} l; /* long form pointers */
/* those are from xfs_bmap_btree.h */
/*
* Bmap root header, on-disk form only.
*/
typedef struct xfs_bmdr_block
{
/*
* Bmap btree record and extent descriptor.
* For 32-bit kernels,
* l0:31 is an extent flag (value 1 indicates non-normal).
* l0:0-30 and l1:9-31 are startoff.
* l1:0-8, l2:0-31, and l3:21-31 are startblock.
* l3:0-20 are blockcount.
* For 64-bit kernels,
* l0:63 is an extent flag (value 1 indicates non-normal).
* l0:9-62 are startoff.
* l0:0-8 and l1:21-63 are startblock.
* l1:0-20 are blockcount.
*/
typedef struct xfs_bmbt_rec_32
{
typedef struct xfs_bmbt_rec_64
{
#if BMBT_USE_64
#else /* !BMBT_USE_64 */
#endif /* BMBT_USE_64 */
/*
* Key structure for non-leaf levels of the tree.
*/
typedef struct xfs_bmbt_key
{
/* btree block header type */
/* those are from xfs_dir2.h */
/*
* Directory version 2.
* There are 4 possible formats:
* shortform
* single block - data with embedded leaf at the end
* multiple data blocks, single leaf+freeindex block
* data blocks, node&leaf blocks (btree), freeindex blocks
*
* The shortform format is in xfs_dir2_sf.h.
* The single block format is in xfs_dir2_block.h.
* The data block format is in xfs_dir2_data.h.
* The leaf and freeindex block formats are in xfs_dir2_leaf.h.
* Node blocks are the same as the other version, in xfs_da_btree.h.
*/
/*
* Byte offset in data block and shortform entry.
*/
/*
* Byte offset in a directory.
*/
/* those are from xfs_da_btree.h */
/*========================================================================
* Directory Structure when greater than XFS_LBSIZE(mp) bytes.
*========================================================================*/
/*
* This structure is common to both leaf nodes and non-leaf nodes in the Btree.
*
* Is is used to manage a doubly linked list of all blocks at the same
* level in the Btree, and to identify which type of block this is.
*/
typedef struct xfs_da_blkinfo {
/*
* This is the structure of the root and intermediate nodes in the Btree.
* The leaf nodes are defined above.
*
* Entries are not packed.
*
* Since we have duplicate keys, use a binary search but always follow
* all match in the block, not just the first match found.
*/
typedef struct xfs_da_intnode {
} hdr;
struct xfs_da_node_entry {
/* those are from xfs_dir2_data.h */
/*
* Directory format 2, data block structures.
*/
/*
* Constants.
*/
/*
* Structures.
*/
/*
* Describe a free area in the data block.
* The freespace will be formatted as a xfs_dir2_data_unused_t.
*/
typedef struct xfs_dir2_data_free {
/*
* Header for the data blocks.
* Always at the beginning of a directory-sized block.
* The code knows that XFS_DIR2_DATA_FD_COUNT is 3.
*/
typedef struct xfs_dir2_data_hdr {
/* or XFS_DIR2_BLOCK_MAGIC */
/*
* Active entry in a data block. Aligned to 8 bytes.
* Tag appears as the last 2 bytes.
*/
typedef struct xfs_dir2_data_entry {
/* variable offset */
/*
* Unused entry in a data block. Aligned to 8 bytes.
* Tag appears as the last 2 bytes.
*/
typedef struct xfs_dir2_data_unused {
/* variable offset */
typedef union {
/* those are from xfs_dir2_leaf.h */
/*
* Directory version 2, leaf block structures.
*/
/*
* Leaf block header.
*/
typedef struct xfs_dir2_leaf_hdr {
/* those are from xfs_dir2_block.h */
/*
* Directory version 2, single block format structures
*/
/*
* The single block format is as follows:
* xfs_dir2_data_hdr_t structure
* xfs_dir2_data_entry_t and xfs_dir2_data_unused_t structures
* xfs_dir2_leaf_entry_t structures
* xfs_dir2_block_tail_t structure
*/
typedef struct xfs_dir2_block_tail {
/* those are from xfs_dir2_sf.h */
/*
* Directory layout when stored internal to an inode.
*
* Small directories are packed as tightly as possible so as to
* fit into the literal area of the inode.
*/
/*
* Inode number stored as 8 8-bit values.
*/
/*
* Inode number stored as 4 8-bit values.
* Works a lot of the time, when all the inode numbers in a directory
* fit in 32 bits.
*/
typedef union {
/*
* Normalized offset (in a data block) of the entry, really xfs_dir2_data_off_t.
* Only need 16 bits, this is the byte offset into the single block form.
*/
/*
* The parent directory has a dedicated field, and the self-pointer must
* be calculated on the fly.
*
* Entries are packed toward the top as tightly as possible. The header
* and the elements must be bcopy()'d out into a work area to get correct
* alignment for the inode number fields.
*/
typedef struct xfs_dir2_sf_hdr {
typedef struct xfs_dir2_sf_entry {
typedef struct xfs_dir2_sf {
/* those are from xfs_dinode.h */
/*
* Disk inode structure.
* This is just the header; the inode is expanded to fill a variable size
* with the last field expanding. It is split into the core and "other"
* because we only need the core part in the in-core inode.
*/
typedef struct xfs_timestamp {
/*
* Note: Coordinate changes to this structure with the XFS_DI_* #defines
* below and the offsets table in xfs_ialloc_log_di().
*/
typedef struct xfs_dinode_core
{
typedef struct xfs_dinode
{
union {
} di_u;
} xfs_dinode_t;
/*
* Values for di_format
*/
typedef enum xfs_dinode_fmt
{
/* LNK: di_symlink */
/*
* File types (mode field)
*/