linux/include/uapi/linux/gfs2_ondisk.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
 * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
 * Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
 *
 * This copyrighted material is made available to anyone wishing to use,
 * modify, copy, or redistribute it subject to the terms and conditions
 * of the GNU General Public License v.2.
 */

#ifndef __GFS2_ONDISK_DOT_H__
#define __GFS2_ONDISK_DOT_H__

#include <linux/types.h>

#define GFS2_MAGIC
#define GFS2_BASIC_BLOCK
#define GFS2_BASIC_BLOCK_SHIFT

/* Lock numbers of the LM_TYPE_NONDISK type */

#define GFS2_MOUNT_LOCK
#define GFS2_LIVE_LOCK
#define GFS2_FREEZE_LOCK
#define GFS2_RENAME_LOCK
#define GFS2_CONTROL_LOCK
#define GFS2_MOUNTED_LOCK

/* Format numbers for various metadata types */

#define GFS2_FORMAT_NONE
#define GFS2_FORMAT_SB
#define GFS2_FORMAT_RG
#define GFS2_FORMAT_RB
#define GFS2_FORMAT_DI
#define GFS2_FORMAT_IN
#define GFS2_FORMAT_LF
#define GFS2_FORMAT_JD
#define GFS2_FORMAT_LH
#define GFS2_FORMAT_LD
#define GFS2_FORMAT_LB
#define GFS2_FORMAT_EA
#define GFS2_FORMAT_ED
#define GFS2_FORMAT_QC
/* These are format numbers for entities contained in files */
#define GFS2_FORMAT_RI
#define GFS2_FORMAT_DE
#define GFS2_FORMAT_QU
/* These are part of the superblock */
#define GFS2_FORMAT_FS
#define GFS2_FORMAT_MULTI

/*
 * An on-disk inode number
 */

struct gfs2_inum {};

/*
 * Generic metadata head structure
 * Every inplace buffer logged in the journal must start with this.
 */

#define GFS2_METATYPE_NONE
#define GFS2_METATYPE_SB
#define GFS2_METATYPE_RG
#define GFS2_METATYPE_RB
#define GFS2_METATYPE_DI
#define GFS2_METATYPE_IN
#define GFS2_METATYPE_LF
#define GFS2_METATYPE_JD
#define GFS2_METATYPE_LH
#define GFS2_METATYPE_LD
#define GFS2_METATYPE_LB
#define GFS2_METATYPE_EA
#define GFS2_METATYPE_ED
#define GFS2_METATYPE_QC

struct gfs2_meta_header {};

/*
 * super-block structure
 *
 * It's probably good if SIZEOF_SB <= GFS2_BASIC_BLOCK (512 bytes)
 *
 * Order is important, need to be able to read old superblocks to do on-disk
 * version upgrades.
 */

/* Address of superblock in GFS2 basic blocks */
#define GFS2_SB_ADDR

/* The lock number for the superblock (must be zero) */
#define GFS2_SB_LOCK

/* Requirement:  GFS2_LOCKNAME_LEN % 8 == 0
   Includes: the fencing zero at the end */
#define GFS2_LOCKNAME_LEN

struct gfs2_sb {};

/*
 * resource index structure
 */

struct gfs2_rindex {};

/*
 * resource group header structure
 */

/* Number of blocks per byte in rgrp */
#define GFS2_NBBY
#define GFS2_BIT_SIZE
#define GFS2_BIT_MASK

#define GFS2_BLKST_FREE
#define GFS2_BLKST_USED
#define GFS2_BLKST_UNLINKED
#define GFS2_BLKST_DINODE

#define GFS2_RGF_JOURNAL
#define GFS2_RGF_METAONLY
#define GFS2_RGF_DATAONLY
#define GFS2_RGF_NOALLOC
#define GFS2_RGF_TRIMMED

struct gfs2_inode_lvb {};

struct gfs2_rgrp_lvb {};

struct gfs2_rgrp {};

/*
 * quota structure
 */

struct gfs2_quota {};

/*
 * dinode structure
 */

#define GFS2_MAX_META_HEIGHT
#define GFS2_DIR_MAX_DEPTH

#define DT2IF(dt)
#define IF2DT(sif)

enum {};

/* Dinode flags */
#define GFS2_DIF_JDATA
#define GFS2_DIF_EXHASH
#define GFS2_DIF_UNUSED
#define GFS2_DIF_EA_INDIRECT
#define GFS2_DIF_DIRECTIO
#define GFS2_DIF_IMMUTABLE
#define GFS2_DIF_APPENDONLY
#define GFS2_DIF_NOATIME
#define GFS2_DIF_SYNC
#define GFS2_DIF_SYSTEM
#define GFS2_DIF_TOPDIR
#define GFS2_DIF_TRUNC_IN_PROG
#define GFS2_DIF_INHERIT_DIRECTIO
#define GFS2_DIF_INHERIT_JDATA

struct gfs2_dinode {};

/*
 * directory structure - many of these per directory file
 */

#define GFS2_FNAMESIZE
#define GFS2_DIRENT_SIZE(name_len)
#define GFS2_MIN_DIRENT_SIZE


struct gfs2_dirent {};

/*
 * Header of leaf directory nodes
 */

struct gfs2_leaf {};

/*
 * Extended attribute header format
 *
 * This works in a similar way to dirents. There is a fixed size header
 * followed by a variable length section made up of the name and the
 * associated data. In the case of a "stuffed" entry, the value is
 * inline directly after the name, the ea_num_ptrs entry will be
 * zero in that case. For non-"stuffed" entries, there will be
 * a set of pointers (aligned to 8 byte boundary) to the block(s)
 * containing the value.
 *
 * The blocks containing the values and the blocks containing the
 * extended attribute headers themselves all start with the common
 * metadata header. Each inode, if it has extended attributes, will
 * have either a single block containing the extended attribute headers
 * or a single indirect block pointing to blocks containing the
 * extended attribute headers.
 *
 * The maximum size of the data part of an extended attribute is 64k
 * so the number of blocks required depends upon block size. Since the
 * block size also determines the number of pointers in an indirect
 * block, its a fairly complicated calculation to work out the maximum
 * number of blocks that an inode may have relating to extended attributes.
 *
 */

#define GFS2_EA_MAX_NAME_LEN
#define GFS2_EA_MAX_DATA_LEN

#define GFS2_EATYPE_UNUSED
#define GFS2_EATYPE_USR
#define GFS2_EATYPE_SYS
#define GFS2_EATYPE_SECURITY
#define GFS2_EATYPE_TRUSTED

#define GFS2_EATYPE_LAST
#define GFS2_EATYPE_VALID(x)

#define GFS2_EAFLAG_LAST

struct gfs2_ea_header {};

/*
 * Log header structure
 */

#define GFS2_LOG_HEAD_UNMOUNT
#define GFS2_LOG_HEAD_FLUSH_NORMAL
#define GFS2_LOG_HEAD_FLUSH_SYNC
#define GFS2_LOG_HEAD_FLUSH_SHUTDOWN
#define GFS2_LOG_HEAD_FLUSH_FREEZE
#define GFS2_LOG_HEAD_RECOVERY
#define GFS2_LOG_HEAD_USERSPACE

/* Log flush callers */
#define GFS2_LFC_SHUTDOWN
#define GFS2_LFC_JDATA_WPAGES
#define GFS2_LFC_SET_FLAGS
#define GFS2_LFC_AIL_EMPTY_GL
#define GFS2_LFC_AIL_FLUSH
#define GFS2_LFC_RGRP_GO_SYNC
#define GFS2_LFC_INODE_GO_SYNC
#define GFS2_LFC_INODE_GO_INVAL
#define GFS2_LFC_FREEZE_GO_SYNC
#define GFS2_LFC_KILL_SB
#define GFS2_LFC_DO_SYNC
#define GFS2_LFC_INPLACE_RESERVE
#define GFS2_LFC_WRITE_INODE
#define GFS2_LFC_MAKE_FS_RO
#define GFS2_LFC_SYNC_FS
#define GFS2_LFC_EVICT_INODE
#define GFS2_LFC_TRANS_END
#define GFS2_LFC_LOGD_JFLUSH_REQD
#define GFS2_LFC_LOGD_AIL_FLUSH_REQD

#define LH_V1_SIZE

struct gfs2_log_header {};

/*
 * Log type descriptor
 */

#define GFS2_LOG_DESC_METADATA
/* ld_data1 is the number of metadata blocks in the descriptor.
   ld_data2 is unused. */

#define GFS2_LOG_DESC_REVOKE
/* ld_data1 is the number of revoke blocks in the descriptor.
   ld_data2 is unused. */

#define GFS2_LOG_DESC_JDATA
/* ld_data1 is the number of data blocks in the descriptor.
   ld_data2 is unused. */

struct gfs2_log_descriptor {};

/*
 * Inum Range
 * Describe a range of formal inode numbers allocated to
 * one machine to assign to inodes.
 */

#define GFS2_INUM_QUANTUM

struct gfs2_inum_range {};

/*
 * Statfs change
 * Describes an change to the pool of free and allocated
 * blocks.
 */

struct gfs2_statfs_change {};

/*
 * Quota change
 * Describes an allocation change for a particular
 * user or group.
 */

#define GFS2_QCF_USER

struct gfs2_quota_change {};

struct gfs2_quota_lvb {};

#endif /* __GFS2_ONDISK_DOT_H__ */