fs/xfs/libxfs/xfs_group.h
Source file repositories/reference/linux-study-clean/fs/xfs/libxfs/xfs_group.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/libxfs/xfs_group.h- Extension
.h- Size
- 4923 bytes
- Lines
- 193
- 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
- No C-style include directives detected by the generator.
Detected Declarations
struct xfs_groupfunction xfs_group_max_blocksfunction xfs_groups_to_rfsbsfunction xfs_group_start_fsbfunction xfs_gbno_to_fsbfunction xfs_gbno_to_daddrfunction xfs_fsb_to_gnofunction xfs_fsb_to_gbnofunction xfs_verify_gbnofunction xfs_verify_gbext
Annotated Snippet
struct xfs_group {
struct xfs_mount *xg_mount;
uint32_t xg_gno;
enum xfs_group_type xg_type;
atomic_t xg_ref; /* passive reference count */
atomic_t xg_active_ref; /* active reference count */
/* Precalculated geometry info */
uint32_t xg_block_count; /* max usable gbno */
uint32_t xg_min_gbno; /* min usable gbno */
#ifdef __KERNEL__
/* -- kernel only structures below this line -- */
union {
/*
* For perags and non-zoned RT groups:
* Track freed but not yet committed extents.
*/
struct xfs_extent_busy_tree *xg_busy_extents;
/*
* For zoned RT groups:
* List of groups that need a zone reset.
*
* The zonegc code forces a log flush of the rtrmap inode before
* resetting the write pointer, so there is no need for
* individual busy extent tracking.
*/
struct xfs_group *xg_next_reset;
};
/*
* Bitsets of per-ag metadata that have been checked and/or are sick.
* Callers should hold xg_state_lock before accessing this field.
*/
uint16_t xg_checked;
uint16_t xg_sick;
spinlock_t xg_state_lock;
/*
* We use xfs_drain to track the number of deferred log intent items
* that have been queued (but not yet processed) so that waiters (e.g.
* scrub) will not lock resources when other threads are in the middle
* of processing a chain of intent items only to find momentary
* inconsistencies.
*/
struct xfs_defer_drain xg_intents_drain;
/*
* Hook to feed rmapbt updates to an active online repair.
*/
struct xfs_hooks xg_rmap_update_hooks;
#endif /* __KERNEL__ */
};
struct xfs_group *xfs_group_get(struct xfs_mount *mp, uint32_t index,
enum xfs_group_type type);
struct xfs_group *xfs_group_get_by_fsb(struct xfs_mount *mp,
xfs_fsblock_t fsbno, enum xfs_group_type type);
struct xfs_group *xfs_group_hold(struct xfs_group *xg);
void xfs_group_put(struct xfs_group *xg);
struct xfs_group *xfs_group_grab(struct xfs_mount *mp, uint32_t index,
enum xfs_group_type type);
struct xfs_group *xfs_group_next_range(struct xfs_mount *mp,
struct xfs_group *xg, uint32_t start_index, uint32_t end_index,
enum xfs_group_type type);
struct xfs_group *xfs_group_grab_next_mark(struct xfs_mount *mp,
struct xfs_group *xg, xa_mark_t mark, enum xfs_group_type type);
void xfs_group_rele(struct xfs_group *xg);
void xfs_group_free(struct xfs_mount *mp, uint32_t index,
enum xfs_group_type type, void (*uninit)(struct xfs_group *xg));
int xfs_group_insert(struct xfs_mount *mp, struct xfs_group *xg,
uint32_t index, enum xfs_group_type);
#define xfs_group_set_mark(_xg, _mark) \
xa_set_mark(&(_xg)->xg_mount->m_groups[(_xg)->xg_type].xa, \
(_xg)->xg_gno, (_mark))
#define xfs_group_clear_mark(_xg, _mark) \
xa_clear_mark(&(_xg)->xg_mount->m_groups[(_xg)->xg_type].xa, \
(_xg)->xg_gno, (_mark))
#define xfs_group_marked(_mp, _type, _mark) \
xa_marked(&(_mp)->m_groups[(_type)].xa, (_mark))
static inline xfs_agblock_t
xfs_group_max_blocks(
struct xfs_group *xg)
{
Annotation
- Detected declarations: `struct xfs_group`, `function xfs_group_max_blocks`, `function xfs_groups_to_rfsbs`, `function xfs_group_start_fsb`, `function xfs_gbno_to_fsb`, `function xfs_gbno_to_daddr`, `function xfs_fsb_to_gno`, `function xfs_fsb_to_gbno`, `function xfs_verify_gbno`, `function xfs_verify_gbext`.
- 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.