linux/fs/xfs/libxfs/xfs_types.h

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
 * All Rights Reserved.
 */
#ifndef __XFS_TYPES_H__
#define __XFS_TYPES_H__

prid_t;		/* project ID */

xfs_agblock_t;	/* blockno in alloc. group */
xfs_agino_t;	/* inode # within allocation grp */
xfs_extlen_t;	/* extent length in blocks */
xfs_rtxlen_t;	/* file extent length in rtextents */
xfs_agnumber_t;	/* allocation group number */
xfs_extnum_t;	/* # of extents in a file */
xfs_aextnum_t;	/* # extents in an attribute fork */
xfs_fsize_t;	/* bytes in a file */
xfs_ufsize_t;	/* unsigned bytes in a file */

xfs_suminfo_t;	/* type of bitmap summary info */
xfs_rtsumoff_t;	/* offset of an rtsummary info word */
xfs_rtword_t;	/* word type for bitmap manipulations */

xfs_lsn_t;	/* log sequence number */
xfs_csn_t;	/* CIL sequence number */

xfs_dablk_t;	/* dir/attr block number (in file) */
xfs_dahash_t;	/* dir/attr hash value */

xfs_fsblock_t;	/* blockno in filesystem (agno|agbno) */
xfs_rfsblock_t;	/* blockno in filesystem (raw) */
xfs_rtblock_t;	/* extent (block) in realtime area */
xfs_fileoff_t;	/* block number in a file */
xfs_filblks_t;	/* number of blocks in a file */
xfs_rtxnum_t;	/* rtextent number */
xfs_rtbxlen_t;	/* rtbitmap extent length in rtextents */

xfs_srtblock_t;	/* signed version of xfs_rtblock_t */

/*
 * New verifiers will return the instruction address of the failing check.
 * NULL means everything is ok.
 */
xfs_failaddr_t;

/*
 * Null values for the types.
 */
#define NULLFSBLOCK
#define NULLRFSBLOCK
#define NULLRTBLOCK
#define NULLFILEOFF

#define NULLAGBLOCK
#define NULLAGNUMBER

#define NULLCOMMITLSN

#define NULLFSINO
#define NULLAGINO

/*
 * Minimum and maximum blocksize and sectorsize.
 * The blocksize upper limit is pretty much arbitrary.
 * The sectorsize upper limit is due to sizeof(sb_sectsize).
 * CRC enable filesystems use 512 byte inodes, meaning 512 byte block sizes
 * cannot be used.
 */
#define XFS_MIN_BLOCKSIZE_LOG
#define XFS_MAX_BLOCKSIZE_LOG
#define XFS_MIN_BLOCKSIZE
#define XFS_MAX_BLOCKSIZE
#define XFS_MIN_CRC_BLOCKSIZE
#define XFS_MIN_SECTORSIZE_LOG
#define XFS_MAX_SECTORSIZE_LOG
#define XFS_MIN_SECTORSIZE
#define XFS_MAX_SECTORSIZE

/*
 * Inode fork identifiers.
 */
#define XFS_STAGING_FORK
#define XFS_DATA_FORK
#define XFS_ATTR_FORK
#define XFS_COW_FORK

#define XFS_WHICHFORK_STRINGS

/*
 * Min numbers of data/attr fork btree root pointers.
 */
#define MINDBTPTRS
#define MINABTPTRS

/*
 * MAXNAMELEN is the length (including the terminating null) of
 * the longest permissible file (component) name.
 */
#define MAXNAMELEN

/*
 * This enum is used in string mapping in xfs_trace.h; please keep the
 * TRACE_DEFINE_ENUMs for it up to date.
 */
xfs_lookup_t;

#define XFS_AG_BTREE_CMP_FORMAT_STR

struct xfs_name {};

/*
 * uid_t and gid_t are hard-coded to 32 bits in the inode.
 * Hence, an 'id' in a dquot is 32 bits..
 */
xfs_dqid_t;

/*
 * Constants for bit manipulations.
 */
#define XFS_NBBYLOG
#define XFS_WORDLOG
#define XFS_SUMINFOLOG
#define XFS_NBWORDLOG
#define XFS_NBWORD
#define XFS_WORDMASK

struct xfs_iext_cursor {};

xfs_exntst_t;

xfs_bmbt_irec_t;

enum xfs_refc_domain {};

#define XFS_REFC_DOMAIN_STRINGS

struct xfs_refcount_irec {};

#define XFS_RMAP_ATTR_FORK
#define XFS_RMAP_BMBT_BLOCK
#define XFS_RMAP_UNWRITTEN
#define XFS_RMAP_KEY_FLAGS
#define XFS_RMAP_REC_FLAGS
struct xfs_rmap_irec {};

/* per-AG block reservation types */
enum xfs_ag_resv_type {};

/* Results of scanning a btree keyspace to check occupancy. */
enum xbtree_recpacking {};

/*
 * Type verifier functions
 */
struct xfs_mount;

bool xfs_verify_fsbno(struct xfs_mount *mp, xfs_fsblock_t fsbno);
bool xfs_verify_fsbext(struct xfs_mount *mp, xfs_fsblock_t fsbno,
		xfs_fsblock_t len);

bool xfs_verify_ino(struct xfs_mount *mp, xfs_ino_t ino);
bool xfs_internal_inum(struct xfs_mount *mp, xfs_ino_t ino);
bool xfs_verify_dir_ino(struct xfs_mount *mp, xfs_ino_t ino);
bool xfs_verify_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno);
bool xfs_verify_rtbext(struct xfs_mount *mp, xfs_rtblock_t rtbno,
		xfs_filblks_t len);
bool xfs_verify_icount(struct xfs_mount *mp, unsigned long long icount);
bool xfs_verify_dablk(struct xfs_mount *mp, xfs_fileoff_t off);
void xfs_icount_range(struct xfs_mount *mp, unsigned long long *min,
		unsigned long long *max);
bool xfs_verify_fileoff(struct xfs_mount *mp, xfs_fileoff_t off);
bool xfs_verify_fileext(struct xfs_mount *mp, xfs_fileoff_t off,
		xfs_fileoff_t len);

/* Do we support an rt volume having this number of rtextents? */
static inline bool
xfs_validate_rtextents(
	xfs_rtbxlen_t		rtextents)
{}

#endif	/* __XFS_TYPES_H__ */