fs/xfs/scrub/rcbag_btree.h
Source file repositories/reference/linux-study-clean/fs/xfs/scrub/rcbag_btree.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/scrub/rcbag_btree.h- Extension
.h- Size
- 2337 bytes
- Lines
- 82
- 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 rcbag_keystruct rcbag_rec
Annotated Snippet
struct rcbag_key {
uint32_t rbg_startblock;
uint32_t rbg_blockcount;
};
struct rcbag_rec {
uint32_t rbg_startblock;
uint32_t rbg_blockcount;
uint64_t rbg_refcount;
};
typedef __be64 rcbag_ptr_t;
/* reflinks only exist on crc enabled filesystems */
#define RCBAG_BLOCK_LEN XFS_BTREE_LBLOCK_CRC_LEN
/*
* Record, key, and pointer address macros for btree blocks.
*
* (note that some of these may appear unused, but they are used in userspace)
*/
#define RCBAG_REC_ADDR(block, index) \
((struct rcbag_rec *) \
((char *)(block) + RCBAG_BLOCK_LEN + \
(((index) - 1) * sizeof(struct rcbag_rec))))
#define RCBAG_KEY_ADDR(block, index) \
((struct rcbag_key *) \
((char *)(block) + RCBAG_BLOCK_LEN + \
((index) - 1) * sizeof(struct rcbag_key)))
#define RCBAG_PTR_ADDR(block, index, maxrecs) \
((rcbag_ptr_t *) \
((char *)(block) + RCBAG_BLOCK_LEN + \
(maxrecs) * sizeof(struct rcbag_key) + \
((index) - 1) * sizeof(rcbag_ptr_t)))
unsigned int rcbagbt_maxrecs(struct xfs_mount *mp, unsigned int blocklen,
bool leaf);
unsigned long long rcbagbt_calc_size(unsigned long long nr_records);
unsigned int rcbagbt_maxlevels_possible(void);
int __init rcbagbt_init_cur_cache(void);
void rcbagbt_destroy_cur_cache(void);
struct xfs_btree_cur *rcbagbt_mem_cursor(struct xfs_mount *mp,
struct xfs_trans *tp, struct xfbtree *xfbtree);
int rcbagbt_mem_init(struct xfs_mount *mp, struct xfbtree *xfbtree,
struct xfs_buftarg *btp);
int rcbagbt_lookup_eq(struct xfs_btree_cur *cur,
const struct xfs_rmap_irec *rmap, int *success);
int rcbagbt_get_rec(struct xfs_btree_cur *cur, struct rcbag_rec *rec, int *has);
int rcbagbt_update(struct xfs_btree_cur *cur, const struct rcbag_rec *rec);
int rcbagbt_insert(struct xfs_btree_cur *cur, const struct rcbag_rec *rec,
int *success);
#else
# define rcbagbt_init_cur_cache() 0
# define rcbagbt_destroy_cur_cache() ((void)0)
#endif /* CONFIG_XFS_BTREE_IN_MEM */
#endif /* __XFS_SCRUB_RCBAG_BTREE_H__ */
Annotation
- Detected declarations: `struct xfs_buf`, `struct xfs_btree_cur`, `struct xfs_mount`, `struct rcbag_key`, `struct rcbag_rec`.
- 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.