Lines Matching +full:high +full:- +full:fidelity
1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
12 * This header file defines all the on-disk format definitions for
26 * Fits into a sector-sized buffer at address 0 of each allocation group.
31 #define XFS_SB_VERSION_2 2 /* 6.2 - attributes */
32 #define XFS_SB_VERSION_3 3 /* 6.2 - new inode version */
33 #define XFS_SB_VERSION_4 4 /* 6.2+ - bitmask version */
47 #define XFS_SB_VERSION_BORGBIT 0x4000 /* ASCII only case-insens. */
93 * Superblock - in core version. Must be padded to 64 bit alignment.
101 uuid_t sb_uuid; /* user-visible file system unique id */
189 * Superblock - on disk version.
198 uuid_t sb_uuid; /* user-visible file system unique id */
288 * Misc. Flags - warning - these will be cleared by xfs_repair unless
292 #define XFS_SBF_READONLY 0x01 /* only read-only mounts allowed */
299 #define XFS_SB_VERSION_NUM(sbp) ((sbp)->sb_versionnum & XFS_SB_VERSION_NUMBITS)
312 return sbp->sb_bad_features2 != sbp->sb_features2; in xfs_sb_has_mismatched_features2()
318 (sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT); in xfs_sb_version_hasmorebits()
323 sbp->sb_versionnum |= XFS_SB_VERSION_ATTRBIT; in xfs_sb_version_addattr()
328 sbp->sb_versionnum |= XFS_SB_VERSION_QUOTABIT; in xfs_sb_version_addquota()
333 sbp->sb_versionnum |= XFS_SB_VERSION_MOREBITSBIT; in xfs_sb_version_addattr2()
334 sbp->sb_features2 |= XFS_SB_VERSION2_ATTR2BIT; in xfs_sb_version_addattr2()
339 sbp->sb_versionnum |= XFS_SB_VERSION_MOREBITSBIT; in xfs_sb_version_addprojid32()
340 sbp->sb_features2 |= XFS_SB_VERSION2_PROJID32BIT; in xfs_sb_version_addprojid32()
348 * and so can mount read-write without issues.
350 * RO-Compat (read only) are features that old kernels can read but will break
351 * if they write. Hence only read-only mounts of such filesystems are allowed on
357 * Log-InCompat features are for changes to log formats or new transactions that
368 return (sbp->sb_features_compat & feature) != 0; in xfs_sb_has_compat_feature()
386 return (sbp->sb_features_ro_compat & feature) != 0; in xfs_sb_has_ro_compat_feature()
415 return (sbp->sb_features_incompat & feature) != 0; in xfs_sb_has_incompat_feature()
427 return (sbp->sb_features_log_incompat & feature) != 0; in xfs_sb_has_incompat_log_feature()
434 sbp->sb_features_log_incompat &= ~XFS_SB_FEAT_INCOMPAT_LOG_ALL; in xfs_sb_remove_incompat_log_features()
442 sbp->sb_features_log_incompat |= features; in xfs_sb_add_incompat_log_features()
447 return xfs_sb_is_v5(sbp) && (sbp->sb_features_log_incompat & in xfs_sb_version_haslogxattrs()
454 return (ino == sbp->sb_uquotino || in xfs_is_quota_inode()
455 ino == sbp->sb_gquotino || in xfs_is_quota_inode()
456 ino == sbp->sb_pquotino); in xfs_is_quota_inode()
471 #define XFS_FSS_TO_BB(mp,sec) ((sec) << (mp)->m_sectbb_log)
476 #define XFS_FSB_TO_BB(mp,fsbno) ((fsbno) << (mp)->m_blkbb_log)
478 (((bb) + (XFS_FSB_TO_BB(mp,1) - 1)) >> (mp)->m_blkbb_log)
479 #define XFS_BB_TO_FSBT(mp,bb) ((bb) >> (mp)->m_blkbb_log)
484 #define XFS_FSB_TO_B(mp,fsbno) ((xfs_fsize_t)(fsbno) << (mp)->m_sb.sb_blocklog)
486 ((((uint64_t)(b)) + (mp)->m_blockmask) >> (mp)->m_sb.sb_blocklog)
487 #define XFS_B_TO_FSBT(mp,b) (((uint64_t)(b)) >> (mp)->m_sb.sb_blocklog)
492 * This is divided into three structures, placed in sequential 512-byte
493 * buffers after a copy of the superblock (also in a 512-byte buffer).
580 #define XFS_AGF_ALL_BITS ((1u << XFS_AGF_NUM_BITS) - 1)
603 #define XFS_AGF_DADDR(mp) ((xfs_daddr_t)(1 << (mp)->m_sectbb_log))
667 #define XFS_AGI_ALL_BITS_R1 ((1u << XFS_AGI_NUM_BITS_R1) - 1)
674 #define XFS_AGI_DADDR(mp) ((xfs_daddr_t)(2 << (mp)->m_sectbb_log))
681 #define XFS_AGFL_DADDR(mp) ((xfs_daddr_t)(3 << (mp)->m_sectbb_log))
683 #define XFS_BUF_TO_AGFL(bp) ((struct xfs_agfl *)((bp)->b_addr))
696 (((xfs_fsblock_t)(agno) << (mp)->m_sb.sb_agblklog) | (agbno))
698 ((xfs_agnumber_t)((fsbno) >> (mp)->m_sb.sb_agblklog))
700 ((xfs_agblock_t)((fsbno) & xfs_mask32lo((mp)->m_sb.sb_agblklog)))
703 (xfs_fsblock_t)(agno) * (mp)->m_sb.sb_agblocks + (agbno)))
715 xfs_daddr_to_agno(mp, (d) + (len) - 1)))
719 * stored in host-endian format. Starting with the realtime groups feature,
729 * stored in host-endian format. Starting with the realtime groups feature,
739 * could be locked independently. Realtime block group numbers are 32-bit
740 * quantities. Block numbers within a group are also 32-bit quantities, but
744 #define XFS_MAX_RGBLOCKS ((xfs_rgblock_t)(1U << 31) - 1)
746 #define XFS_MAX_RGNUMBER ((xfs_rgnumber_t)(-1U))
751 * Realtime superblock - on disk version. Must be padded to 64 bit alignment.
761 uuid_t rsb_uuid; /* user-visible file system unique id */
774 * Traditional ondisk inode timestamps consist of signed 32-bit counters for
782 * unsigned 64-bit nanoseconds counter. This means that the bigtime inode
823 #define XFS_BIGTIME_TIME_MAX ((int64_t)((-1ULL / NSEC_PER_SEC) & ~0x3ULL))
827 * 32-bit timestamp can represent when using the Unix epoch as a reference.
831 * The bigtime epoch also matches the minimum value an on-disk 32-bit XFS
832 * timestamp can represent so we will not lose any fidelity in converting
838 #define XFS_BIGTIME_EPOCH_OFFSET (-(int64_t)S32_MIN)
849 return (time64_t)ondisk_seconds - XFS_BIGTIME_EPOCH_OFFSET; in xfs_bigtime_to_unix()
878 * On-disk inode structure.
890 * Note: di_flushiter is only used by v1/2 inodes - it's effectively a zeroed
947 /* di_next_unlinked is the only non-core field in the old dinode */
983 * Since the pathconf interface is signed, we use 2^31 - 1 instead.
985 #define XFS_MAXLINK ((1U << 31) - 1U)
989 * a use-after-free situation.
1019 * The original on-disk extent counts were held in signed fields, resulting in
1022 * by the 21-bit wide blockcount field of a BMBT extent record.
1024 * The newly introduced data fork extent counter can hold a 64-bit value,
1026 * extents by the 54-bit wide startoff field of a BMBT extent record.
1034 * Rounding up 47 to the nearest multiple of bits-per-byte results in 48. Hence
1050 #define XFS_MAX_EXTCNT_DATA_FORK_LARGE ((xfs_extnum_t)((1ULL << 48) - 1))
1051 #define XFS_MAX_EXTCNT_ATTR_FORK_LARGE ((xfs_extnum_t)((1ULL << 32) - 1))
1052 #define XFS_MAX_EXTCNT_DATA_FORK_SMALL ((xfs_extnum_t)((1ULL << 31) - 1))
1053 #define XFS_MAX_EXTCNT_ATTR_FORK_SMALL ((xfs_extnum_t)((1ULL << 15) - 1))
1058 * on-disk field. No upgrade operation should ever be adding more than a few
1063 min(XFS_MAX_EXTCNT_ATTR_FORK_LARGE - XFS_MAX_EXTCNT_ATTR_FORK_SMALL, \
1064 XFS_MAX_EXTCNT_DATA_FORK_LARGE - XFS_MAX_EXTCNT_DATA_FORK_SMALL)
1082 ((mp)->m_sb.sb_inodesize - XFS_DINODE_SIZE(mp))
1087 #define XFS_DFORK_BOFF(dip) ((int)((dip)->di_forkoff << 3))
1090 ((dip)->di_forkoff ? XFS_DFORK_BOFF(dip) : XFS_LITINO(mp))
1092 ((dip)->di_forkoff ? XFS_LITINO(mp) - XFS_DFORK_BOFF(dip) : 0)
1105 ((void *)dip + xfs_dinode_size(dip->di_version))
1113 (dip)->di_format : \
1114 (dip)->di_aformat)
1137 #define XFS_DIFLAG_APPEND_BIT 4 /* inode is append-only */
1196 * - V5 filesystem (and ftype) are enabled;
1197 * - The only valid modes are regular files and directories;
1198 * - The access bits must be zero;
1199 * - DMAPI event and state masks are zero;
1200 * - The user and group IDs must be zero;
1201 * - The project ID can be used as a u32 annotation;
1202 * - The immutable, sync, noatime, nodump, nodefrag flags must be set.
1203 * - The dax flag must not be set.
1204 * - Directories must have nosymlinks set.
1212 * - Metadata inodes must never be resolvable through the root directory;
1213 * - They must never be accessed by userspace;
1214 * - Metadata directory entries must have correct ftype.
1216 * Superblock-rooted metadata files must have the METADATA iflag set even
1234 return dip->di_version >= 3 && in xfs_dinode_has_bigtime()
1235 (dip->di_flags2 & cpu_to_be64(XFS_DIFLAG2_BIGTIME)); in xfs_dinode_has_bigtime()
1241 return dip->di_version >= 3 && in xfs_dinode_has_large_extent_counts()
1242 (dip->di_flags2 & cpu_to_be64(XFS_DIFLAG2_NREXT64)); in xfs_dinode_has_large_extent_counts()
1247 return dip->di_version >= 3 && in xfs_dinode_is_metadir()
1248 (dip->di_flags2 & cpu_to_be64(XFS_DIFLAG2_METADATA)); in xfs_dinode_is_metadir()
1253 * low inopblog bits - offset in block
1254 * next agblklog bits - block number in ag
1255 * next agno_log bits - ag number
1256 * high agno_log-agblklog-inopblog bits - 0
1258 #define XFS_INO_MASK(k) (uint32_t)((1ULL << (k)) - 1)
1259 #define XFS_INO_OFFSET_BITS(mp) (mp)->m_sb.sb_inopblog
1260 #define XFS_INO_AGBNO_BITS(mp) (mp)->m_sb.sb_agblklog
1261 #define XFS_INO_AGINO_BITS(mp) ((mp)->m_ino_geo.agino_log)
1262 #define XFS_INO_AGNO_BITS(mp) (mp)->m_agno_log
1286 #define XFS_MAXINUMBER ((xfs_ino_t)((1ULL << 56) - 1ULL))
1287 #define XFS_MAXINUMBER_32 ((xfs_ino_t)((1ULL << 32) - 1ULL))
1339 * Traditional quota grace period expiration timers are an unsigned 32-bit
1348 * max recorded here are the on-disk limits, not a Unix timestamp.
1351 * and is applied to a non-root dquot when it exceeds the soft or hard limits.
1352 * The length of quota grace periods are unsigned 32-bit quantities measured in
1380 * The ondisk field supports values up to -1U, which corresponds to an incore
1391 #define XFS_DQ_BIGTIME_SLACK ((int64_t)(1ULL << XFS_DQ_BIGTIME_SHIFT) - 1)
1412 * to ~136 years. These are applied to a non-root dquot that has exceeded
1422 * This is the main portion of the on-disk representation of quota information
1512 ((bufsize) - (xfs_has_crc((mp)) ? \
1519 * There are two on-disk btrees, one sorted by blockno and one sorted
1565 #define XFS_INOBT_ALL_FREE ((xfs_inofree_t)-1)
1575 return ((n >= XFS_INODES_PER_CHUNK ? 0 : XFS_INOBT_MASK(n)) - 1) << i; in xfs_inobt_maskn()
1579 * The on-disk inode record structure has two formats. The original "full"
1580 * format uses a 4-byte freecount. The "sparse" format uses a 1-byte freecount
1581 * and replaces the 3 high-order freecount bytes wth the holemask and inode
1613 /* non-zero holemask represents a sparse rec. */ in xfs_inobt_issparse()
1641 * Ownership info for an extent. This is used to create reverse-mapping
1659 #define XFS_RMAP_OWN_NULL (-1ULL) /* No owner, for growfs */
1660 #define XFS_RMAP_OWN_UNKNOWN (-2ULL) /* Unknown owner, for EFI recovery */
1661 #define XFS_RMAP_OWN_FS (-3ULL) /* static fs metadata */
1662 #define XFS_RMAP_OWN_LOG (-4ULL) /* static fs metadata */
1663 #define XFS_RMAP_OWN_AG (-5ULL) /* AG freespace btree blocks */
1664 #define XFS_RMAP_OWN_INOBT (-6ULL) /* Inode btree blocks */
1665 #define XFS_RMAP_OWN_INODES (-7ULL) /* Inode chunk */
1666 #define XFS_RMAP_OWN_REFC (-8ULL) /* refcount tree */
1667 #define XFS_RMAP_OWN_COW (-9ULL) /* cow allocations */
1668 #define XFS_RMAP_OWN_MIN (-10ULL) /* guard */
1687 * rm_offset:54-60 aren't used and should be zero
1688 * rm_offset:0-53 is the block offset within the inode
1742 * rtrmap root header, on-disk form only.
1749 /* inode-based btree pointer type */
1770 * Extents with a single owner (attributes, metadata, non-shared file
1772 * This is consistent with pre-reflink XFS.
1809 * rt refcount root header, on-disk form only.
1816 /* inode-rooted btree pointer type */
1829 * Bmap root header, on-disk form only.
1838 * l0:63 is an extent flag (value 1 indicates non-normal).
1839 * l0:9-62 are startoff.
1840 * l0:0-8 and l1:21-63 are startblock.
1841 * l1:0-20 are blockcount.
1848 #define BMBT_STARTOFF_MASK ((1ULL << BMBT_STARTOFF_BITLEN) - 1)
1849 #define BMBT_BLOCKCOUNT_MASK ((1ULL << BMBT_BLOCKCOUNT_BITLEN) - 1)
1867 * Values and macros for delayed-allocation startblock fields.
1872 (((((xfs_fsblock_t)1) << STARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS)
1891 * Key structure for non-leaf levels of the tree.
1973 * On-disk XFS access control list structure.
1988 * The number of ACL entries allowed is defined by the on-disk format.
1994 ? (XFS_XATTR_SIZE_MAX - sizeof(struct xfs_acl)) / \
2006 /* On-disk XFS extended attribute names */
2009 #define SGI_ACL_FILE_SIZE (sizeof(SGI_ACL_FILE)-1)
2010 #define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1)