fs/xfs/libxfs/xfs_rtgroup.h
Source file repositories/reference/linux-study-clean/fs/xfs/libxfs/xfs_rtgroup.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/libxfs/xfs_rtgroup.h- Extension
.h- Size
- 10017 bytes
- Lines
- 390
- 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_rtgroupenum xfs_rtg_inodesfunction rtg_rgnofunction rtg_blocksfunction xfs_rtgroup_getfunction xfs_rtgroup_holdfunction xfs_rtgroup_putfunction xfs_rtgroup_grabfunction xfs_rtgroup_relefunction xfs_rtgroup_next_rangefunction xfs_rtgroup_nextfunction xfs_verify_rgbnofunction xfs_verify_rgbextfunction xfs_rgbno_to_rtbfunction xfs_rtb_to_rgnofunction xfs_rtb_to_rgbnofunction xfs_rtbno_is_group_startfunction xfs_rtx_to_rgbnofunction xfs_rtb_to_daddrfunction xfs_daddr_to_rtbfunction xfs_free_rtgroupsfunction xfs_rtgs_to_rfsbsfunction xfs_rtgroup_raw_size
Annotated Snippet
struct xfs_rtgroup {
struct xfs_group rtg_group;
/* per-rtgroup metadata inodes */
struct xfs_inode *rtg_inodes[XFS_RTGI_MAX];
/* Number of blocks in this group */
xfs_rtxnum_t rtg_extents;
/*
* For bitmap based RT devices this points to a cache of rt summary
* level per bitmap block with the invariant that rtg_rsum_cache[bbno]
* > the maximum i for which rsum[i][bbno] != 0, or 0 if
* rsum[i][bbno] == 0 for all i.
* Reads and writes are serialized by the rsumip inode lock.
*
* For zoned RT devices this points to the open zone structure for
* a group that is open for writers, or is NULL.
*/
union {
uint8_t *rtg_rsum_cache;
struct xfs_open_zone *rtg_open_zone;
};
/*
* Count of outstanding GC operations for zoned XFS. Any RTG with a
* non-zero rtg_gccount will not be picked as new GC victim.
*/
atomic_t rtg_gccount;
};
/*
* For zoned RT devices this is set on groups that have no written blocks
* and can be picked by the allocator for opening.
*/
#define XFS_RTG_FREE XA_MARK_0
static inline struct xfs_rtgroup *to_rtg(struct xfs_group *xg)
{
return container_of(xg, struct xfs_rtgroup, rtg_group);
}
static inline struct xfs_group *rtg_group(struct xfs_rtgroup *rtg)
{
return &rtg->rtg_group;
}
static inline struct xfs_mount *rtg_mount(const struct xfs_rtgroup *rtg)
{
return rtg->rtg_group.xg_mount;
}
static inline xfs_rgnumber_t rtg_rgno(const struct xfs_rtgroup *rtg)
{
return rtg->rtg_group.xg_gno;
}
static inline xfs_rgblock_t rtg_blocks(const struct xfs_rtgroup *rtg)
{
return rtg->rtg_group.xg_block_count;
}
static inline struct xfs_inode *rtg_bitmap(const struct xfs_rtgroup *rtg)
{
return rtg->rtg_inodes[XFS_RTGI_BITMAP];
}
static inline struct xfs_inode *rtg_summary(const struct xfs_rtgroup *rtg)
{
return rtg->rtg_inodes[XFS_RTGI_SUMMARY];
}
static inline struct xfs_inode *rtg_rmap(const struct xfs_rtgroup *rtg)
{
return rtg->rtg_inodes[XFS_RTGI_RMAP];
}
static inline struct xfs_inode *rtg_refcount(const struct xfs_rtgroup *rtg)
{
return rtg->rtg_inodes[XFS_RTGI_REFCOUNT];
}
/* Passive rtgroup references */
static inline struct xfs_rtgroup *
xfs_rtgroup_get(
struct xfs_mount *mp,
xfs_rgnumber_t rgno)
{
return to_rtg(xfs_group_get(mp, rgno, XG_TYPE_RTG));
}
Annotation
- Immediate include surface: `xfs_group.h`.
- Detected declarations: `struct xfs_mount`, `struct xfs_trans`, `struct xfs_rtgroup`, `enum xfs_rtg_inodes`, `function rtg_rgno`, `function rtg_blocks`, `function xfs_rtgroup_get`, `function xfs_rtgroup_hold`, `function xfs_rtgroup_put`, `function xfs_rtgroup_grab`.
- 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.