fs/xfs/libxfs/xfs_ag.h
Source file repositories/reference/linux-study-clean/fs/xfs/libxfs/xfs_ag.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/libxfs/xfs_ag.h- Extension
.h- Size
- 9526 bytes
- Lines
- 363
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
xfs_group.h
Detected Declarations
struct xfs_mountstruct xfs_transstruct xfs_peragstruct xfs_ag_resvstruct xfs_peragstruct aghdr_init_datafunction pag_agnofunction xfs_perag_getfunction xfs_perag_holdfunction xfs_perag_putfunction xfs_perag_grabfunction xfs_perag_relefunction xfs_perag_next_rangefunction xfs_perag_next_fromfunction xfs_perag_nextfunction xfs_verify_agbnofunction xfs_verify_agbextfunction xfs_verify_aginofunction xfs_verify_agino_or_nullfunction xfs_ag_contains_logfunction xfs_perag_next_wrapfunction xfs_agbno_to_fsbfunction xfs_agbno_to_daddrfunction xfs_agino_to_ino
Annotated Snippet
struct xfs_ag_resv {
/* number of blocks originally reserved here */
xfs_extlen_t ar_orig_reserved;
/* number of blocks reserved here */
xfs_extlen_t ar_reserved;
/* number of blocks originally asked for */
xfs_extlen_t ar_asked;
};
/*
* Per-ag incore structure, copies of information in agf and agi, to improve the
* performance of allocation group selection.
*/
struct xfs_perag {
struct xfs_group pag_group;
unsigned long pag_opstate;
uint8_t pagf_bno_level; /* # of levels in bno btree */
uint8_t pagf_cnt_level; /* # of levels in cnt btree */
uint8_t pagf_rmap_level;/* # of levels in rmap btree */
uint32_t pagf_flcount; /* count of blocks in freelist */
xfs_extlen_t pagf_freeblks; /* total free blocks */
xfs_extlen_t pagf_longest; /* longest free space */
uint32_t pagf_btreeblks; /* # of blocks held in AGF btrees */
xfs_agino_t pagi_freecount; /* number of free inodes */
xfs_agino_t pagi_count; /* number of allocated inodes */
/*
* Inode allocation search lookup optimisation.
* If the pagino matches, the search for new inodes
* doesn't need to search the near ones again straight away
*/
xfs_agino_t pagl_pagino;
xfs_agino_t pagl_leftrec;
xfs_agino_t pagl_rightrec;
uint8_t pagf_refcount_level; /* recount btree height */
/* Blocks reserved for all kinds of metadata. */
struct xfs_ag_resv pag_meta_resv;
/* Blocks reserved for the reverse mapping btree. */
struct xfs_ag_resv pag_rmapbt_resv;
/* Precalculated geometry info */
xfs_agino_t agino_min;
xfs_agino_t agino_max;
#ifdef __KERNEL__
/* -- kernel only structures below this line -- */
#ifdef CONFIG_XFS_ONLINE_REPAIR
/*
* Alternate btree heights so that online repair won't trip the write
* verifiers while rebuilding the AG btrees.
*/
uint8_t pagf_repair_bno_level;
uint8_t pagf_repair_cnt_level;
uint8_t pagf_repair_refcount_level;
uint8_t pagf_repair_rmap_level;
#endif
atomic_t pagf_fstrms; /* # of filestreams active in this AG */
spinlock_t pag_ici_lock; /* incore inode cache lock */
struct radix_tree_root pag_ici_root; /* incore inode cache root */
int pag_ici_reclaimable; /* reclaimable inodes */
unsigned long pag_ici_reclaim_cursor; /* reclaim restart point */
/* background prealloc block trimming */
struct delayed_work pag_blockgc_work;
#endif /* __KERNEL__ */
};
static inline struct xfs_perag *to_perag(struct xfs_group *xg)
{
return container_of(xg, struct xfs_perag, pag_group);
}
static inline struct xfs_group *pag_group(struct xfs_perag *pag)
{
return &pag->pag_group;
}
static inline struct xfs_mount *pag_mount(const struct xfs_perag *pag)
{
return pag->pag_group.xg_mount;
}
static inline xfs_agnumber_t pag_agno(const struct xfs_perag *pag)
{
return pag->pag_group.xg_gno;
Annotation
- Immediate include surface: `xfs_group.h`.
- Detected declarations: `struct xfs_mount`, `struct xfs_trans`, `struct xfs_perag`, `struct xfs_ag_resv`, `struct xfs_perag`, `struct aghdr_init_data`, `function pag_agno`, `function xfs_perag_get`, `function xfs_perag_hold`, `function xfs_perag_put`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.