fs/xfs/libxfs/xfs_rtbitmap.h
Source file repositories/reference/linux-study-clean/fs/xfs/libxfs/xfs_rtbitmap.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/libxfs/xfs_rtbitmap.h- Extension
.h- Size
- 11863 bytes
- Lines
- 454
- 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
xfs_rtgroup.h
Detected Declarations
struct xfs_rtalloc_argsstruct xfs_rtalloc_recfunction xfs_rtx_to_rtbfunction xfs_rgbno_to_rtxfunction xfs_rtbxlen_to_blenfunction xfs_rtxlen_to_extlenfunction xfs_extlen_to_rtxmodfunction xfs_extlen_to_rtxlenfunction xfs_blen_to_rtbxlenfunction xfs_blen_to_rtxofffunction xfs_blen_roundup_rtxfunction xfs_rtb_to_rtxfunction xfs_rgbno_to_rtxofffunction xfs_rtb_to_rtxofffunction xfs_fileoff_roundup_rtxfunction xfs_fileoff_rounddown_rtxfunction xfs_rtx_to_rbmblockfunction xfs_rtx_to_rbmwordfunction xfs_rbmblock_to_rtxfunction xfs_rbmblock_wordptrfunction xfs_rtbitmap_getwordfunction xfs_rtbitmap_setwordfunction xfs_rtsumoffsfunction xfs_rtsumoffs_to_blockfunction xfs_rtsumoffs_to_infowordfunction xfs_rsumblock_infoptrfunction xfs_suminfo_getfunction xfs_suminfo_addfunction xfs_rtblock_opsfunction xfs_rtfree_blocksfunction xfs_rtbitmap_blockcount_len
Annotated Snippet
struct xfs_rtalloc_args {
struct xfs_rtgroup *rtg;
struct xfs_mount *mp;
struct xfs_trans *tp;
struct xfs_buf *rbmbp; /* bitmap block buffer */
struct xfs_buf *sumbp; /* summary block buffer */
xfs_fileoff_t rbmoff; /* bitmap block number */
xfs_fileoff_t sumoff; /* summary block number */
};
static inline xfs_rtblock_t
xfs_rtx_to_rtb(
struct xfs_rtgroup *rtg,
xfs_rtxnum_t rtx)
{
struct xfs_mount *mp = rtg_mount(rtg);
xfs_rtblock_t start = xfs_group_start_fsb(rtg_group(rtg));
if (mp->m_rtxblklog >= 0)
return start + (rtx << mp->m_rtxblklog);
return start + (rtx * mp->m_sb.sb_rextsize);
}
/* Convert an rgbno into an rt extent number. */
static inline xfs_rtxnum_t
xfs_rgbno_to_rtx(
struct xfs_mount *mp,
xfs_rgblock_t rgbno)
{
if (likely(mp->m_rtxblklog >= 0))
return rgbno >> mp->m_rtxblklog;
return rgbno / mp->m_sb.sb_rextsize;
}
static inline uint64_t
xfs_rtbxlen_to_blen(
struct xfs_mount *mp,
xfs_rtbxlen_t rtbxlen)
{
if (mp->m_rtxblklog >= 0)
return rtbxlen << mp->m_rtxblklog;
return rtbxlen * mp->m_sb.sb_rextsize;
}
static inline xfs_extlen_t
xfs_rtxlen_to_extlen(
struct xfs_mount *mp,
xfs_rtxlen_t rtxlen)
{
if (mp->m_rtxblklog >= 0)
return rtxlen << mp->m_rtxblklog;
return rtxlen * mp->m_sb.sb_rextsize;
}
/* Compute the misalignment between an extent length and a realtime extent .*/
static inline unsigned int
xfs_extlen_to_rtxmod(
struct xfs_mount *mp,
xfs_extlen_t len)
{
if (mp->m_rtxblklog >= 0)
return len & mp->m_rtxblkmask;
return len % mp->m_sb.sb_rextsize;
}
static inline xfs_rtxlen_t
xfs_extlen_to_rtxlen(
struct xfs_mount *mp,
xfs_extlen_t len)
{
if (mp->m_rtxblklog >= 0)
return len >> mp->m_rtxblklog;
return len / mp->m_sb.sb_rextsize;
}
/* Convert an rt block count into an rt extent count. */
static inline xfs_rtbxlen_t
xfs_blen_to_rtbxlen(
struct xfs_mount *mp,
uint64_t blen)
{
if (likely(mp->m_rtxblklog >= 0))
return blen >> mp->m_rtxblklog;
Annotation
- Immediate include surface: `xfs_rtgroup.h`.
- Detected declarations: `struct xfs_rtalloc_args`, `struct xfs_rtalloc_rec`, `function xfs_rtx_to_rtb`, `function xfs_rgbno_to_rtx`, `function xfs_rtbxlen_to_blen`, `function xfs_rtxlen_to_extlen`, `function xfs_extlen_to_rtxmod`, `function xfs_extlen_to_rtxlen`, `function xfs_blen_to_rtbxlen`, `function xfs_blen_to_rtxoff`.
- 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.