fs/xfs/libxfs/xfs_health.h
Source file repositories/reference/linux-study-clean/fs/xfs/libxfs/xfs_health.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/libxfs/xfs_health.h- Extension
.h- Size
- 11040 bytes
- Lines
- 298
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct xfs_groupstruct xfs_mountstruct xfs_peragstruct xfs_inodestruct xfs_fsop_geomstruct xfs_btree_curstruct xfs_da_argsstruct xfs_rtgroupfunction xfs_fs_has_sicknessfunction xfs_group_has_sicknessfunction xfs_inode_has_sicknessfunction xfs_fs_is_healthyfunction xfs_inode_is_healthy
Annotated Snippet
#ifndef __XFS_HEALTH_H__
#define __XFS_HEALTH_H__
struct xfs_group;
/*
* In-Core Filesystem Health Assessments
* =====================================
*
* We'd like to be able to summarize the current health status of the
* filesystem so that the administrator knows when it's necessary to schedule
* some downtime for repairs. Until then, we would also like to avoid abrupt
* shutdowns due to corrupt metadata.
*
* The online scrub feature evaluates the health of all filesystem metadata.
* When scrub detects corruption in a piece of metadata it will set the
* corresponding sickness flag, and repair will clear it if successful. If
* problems remain at unmount time, we can also request manual intervention by
* logging a notice to run xfs_repair.
*
* Each health tracking group uses a pair of fields for reporting. The
* "checked" field tell us if a given piece of metadata has ever been examined,
* and the "sick" field tells us if that piece was found to need repairs.
* Therefore we can conclude that for a given sick flag value:
*
* - checked && sick => metadata needs repair
* - checked && !sick => metadata is ok
* - !checked && sick => errors have been observed during normal operation,
* but the metadata has not been checked thoroughly
* - !checked && !sick => has not been examined since mount
*
* Evidence of health problems can be sorted into three basic categories:
*
* a) Primary evidence, which signals that something is defective within the
* general grouping of metadata.
*
* b) Secondary evidence, which are side effects of primary problem but are
* not themselves problems. These can be forgotten when the primary
* health problems are addressed.
*
* c) Indirect evidence, which points to something being wrong in another
* group, but we had to release resources and this is all that's left of
* that state.
*/
struct xfs_mount;
struct xfs_perag;
struct xfs_inode;
struct xfs_fsop_geom;
struct xfs_btree_cur;
struct xfs_da_args;
struct xfs_rtgroup;
/* Observable health issues for metadata spanning the entire filesystem. */
#define XFS_SICK_FS_COUNTERS (1 << 0) /* summary counters */
#define XFS_SICK_FS_UQUOTA (1 << 1) /* user quota */
#define XFS_SICK_FS_GQUOTA (1 << 2) /* group quota */
#define XFS_SICK_FS_PQUOTA (1 << 3) /* project quota */
#define XFS_SICK_FS_QUOTACHECK (1 << 4) /* quota counts */
#define XFS_SICK_FS_NLINKS (1 << 5) /* inode link counts */
#define XFS_SICK_FS_METADIR (1 << 6) /* metadata directory tree */
#define XFS_SICK_FS_METAPATH (1 << 7) /* metadata directory tree path */
/* Observable health issues for realtime group metadata. */
#define XFS_SICK_RG_SUPER (1 << 0) /* rt group superblock */
#define XFS_SICK_RG_BITMAP (1 << 1) /* rt group bitmap */
#define XFS_SICK_RG_SUMMARY (1 << 2) /* rt groups summary */
#define XFS_SICK_RG_RMAPBT (1 << 3) /* reverse mappings */
#define XFS_SICK_RG_REFCNTBT (1 << 4) /* reference counts */
/* Observable health issues for AG metadata. */
#define XFS_SICK_AG_SB (1 << 0) /* superblock */
#define XFS_SICK_AG_AGF (1 << 1) /* AGF header */
#define XFS_SICK_AG_AGFL (1 << 2) /* AGFL header */
#define XFS_SICK_AG_AGI (1 << 3) /* AGI header */
#define XFS_SICK_AG_BNOBT (1 << 4) /* free space by block */
#define XFS_SICK_AG_CNTBT (1 << 5) /* free space by length */
#define XFS_SICK_AG_INOBT (1 << 6) /* inode index */
#define XFS_SICK_AG_FINOBT (1 << 7) /* free inode index */
#define XFS_SICK_AG_RMAPBT (1 << 8) /* reverse mappings */
#define XFS_SICK_AG_REFCNTBT (1 << 9) /* reference counts */
#define XFS_SICK_AG_INODES (1 << 10) /* inactivated bad inodes */
/* Observable health issues for inode metadata. */
#define XFS_SICK_INO_CORE (1 << 0) /* inode core */
#define XFS_SICK_INO_BMBTD (1 << 1) /* data fork */
#define XFS_SICK_INO_BMBTA (1 << 2) /* attr fork */
#define XFS_SICK_INO_BMBTC (1 << 3) /* cow fork */
#define XFS_SICK_INO_DIR (1 << 4) /* directory */
#define XFS_SICK_INO_XATTR (1 << 5) /* extended attributes */
Annotation
- Detected declarations: `struct xfs_group`, `struct xfs_mount`, `struct xfs_perag`, `struct xfs_inode`, `struct xfs_fsop_geom`, `struct xfs_btree_cur`, `struct xfs_da_args`, `struct xfs_rtgroup`, `function xfs_fs_has_sickness`, `function xfs_group_has_sickness`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.