fs/xfs/libxfs/xfs_rtrmap_btree.h
Source file repositories/reference/linux-study-clean/fs/xfs/libxfs/xfs_rtrmap_btree.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/libxfs/xfs_rtrmap_btree.h- Extension
.h- Size
- 5976 bytes
- Lines
- 213
- 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_bufstruct xfs_btree_curstruct xfs_mountstruct xbtree_ifakerootstruct xfs_rtgroupstruct xfbtreefunction xfs_rtrmap_rec_addrfunction xfs_rtrmap_key_addrfunction xfs_rtrmap_high_key_addrfunction xfs_rtrmap_ptr_addrfunction xfs_rtrmap_droot_rec_addrfunction xfs_rtrmap_droot_key_addrfunction xfs_rtrmap_droot_ptr_addrfunction xfs_rtrmap_broot_ptr_addrfunction xfs_rtrmap_broot_space_calcfunction xfs_rtrmap_broot_spacefunction xfs_rtrmap_droot_space_calcfunction xfs_rtrmap_droot_space
Annotated Snippet
#ifndef __XFS_RTRMAP_BTREE_H__
#define __XFS_RTRMAP_BTREE_H__
struct xfs_buf;
struct xfs_btree_cur;
struct xfs_mount;
struct xbtree_ifakeroot;
struct xfs_rtgroup;
struct xfbtree;
/* rmaps only exist on crc enabled filesystems */
#define XFS_RTRMAP_BLOCK_LEN XFS_BTREE_LBLOCK_CRC_LEN
struct xfs_btree_cur *xfs_rtrmapbt_init_cursor(struct xfs_trans *tp,
struct xfs_rtgroup *rtg);
struct xfs_btree_cur *xfs_rtrmapbt_stage_cursor(struct xfs_mount *mp,
struct xfs_rtgroup *rtg, struct xfs_inode *ip,
struct xbtree_ifakeroot *ifake);
void xfs_rtrmapbt_commit_staged_btree(struct xfs_btree_cur *cur,
struct xfs_trans *tp);
unsigned int xfs_rtrmapbt_maxrecs(struct xfs_mount *mp, unsigned int blocklen,
bool leaf);
void xfs_rtrmapbt_compute_maxlevels(struct xfs_mount *mp);
unsigned int xfs_rtrmapbt_droot_maxrecs(unsigned int blocklen, bool leaf);
/*
* Addresses of records, keys, and pointers within an incore rtrmapbt block.
*
* (note that some of these may appear unused, but they are used in userspace)
*/
static inline struct xfs_rmap_rec *
xfs_rtrmap_rec_addr(
struct xfs_btree_block *block,
unsigned int index)
{
return (struct xfs_rmap_rec *)
((char *)block + XFS_RTRMAP_BLOCK_LEN +
(index - 1) * sizeof(struct xfs_rmap_rec));
}
static inline struct xfs_rmap_key *
xfs_rtrmap_key_addr(
struct xfs_btree_block *block,
unsigned int index)
{
return (struct xfs_rmap_key *)
((char *)block + XFS_RTRMAP_BLOCK_LEN +
(index - 1) * 2 * sizeof(struct xfs_rmap_key));
}
static inline struct xfs_rmap_key *
xfs_rtrmap_high_key_addr(
struct xfs_btree_block *block,
unsigned int index)
{
return (struct xfs_rmap_key *)
((char *)block + XFS_RTRMAP_BLOCK_LEN +
sizeof(struct xfs_rmap_key) +
(index - 1) * 2 * sizeof(struct xfs_rmap_key));
}
static inline xfs_rtrmap_ptr_t *
xfs_rtrmap_ptr_addr(
struct xfs_btree_block *block,
unsigned int index,
unsigned int maxrecs)
{
return (xfs_rtrmap_ptr_t *)
((char *)block + XFS_RTRMAP_BLOCK_LEN +
maxrecs * 2 * sizeof(struct xfs_rmap_key) +
(index - 1) * sizeof(xfs_rtrmap_ptr_t));
}
unsigned int xfs_rtrmapbt_maxlevels_ondisk(void);
int __init xfs_rtrmapbt_init_cur_cache(void);
void xfs_rtrmapbt_destroy_cur_cache(void);
xfs_filblks_t xfs_rtrmapbt_calc_reserves(struct xfs_mount *mp);
/* Addresses of key, pointers, and records within an ondisk rtrmapbt block. */
static inline struct xfs_rmap_rec *
xfs_rtrmap_droot_rec_addr(
struct xfs_rtrmap_root *block,
unsigned int index)
{
return (struct xfs_rmap_rec *)
((char *)(block + 1) +
(index - 1) * sizeof(struct xfs_rmap_rec));
Annotation
- Detected declarations: `struct xfs_buf`, `struct xfs_btree_cur`, `struct xfs_mount`, `struct xbtree_ifakeroot`, `struct xfs_rtgroup`, `struct xfbtree`, `function xfs_rtrmap_rec_addr`, `function xfs_rtrmap_key_addr`, `function xfs_rtrmap_high_key_addr`, `function xfs_rtrmap_ptr_addr`.
- 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.