fs/btrfs/ref-verify.h
Source file repositories/reference/linux-study-clean/fs/btrfs/ref-verify.h
File Facts
- System
- Linux kernel
- Corpus path
fs/btrfs/ref-verify.h- Extension
.h- Size
- 1299 bytes
- Lines
- 59
- 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
linux/types.hlinux/rbtree_types.hlinux/spinlock.h
Detected Declarations
struct btrfs_fs_infostruct btrfs_reffunction btrfs_init_ref_verifyfunction btrfs_build_ref_treefunction btrfs_free_ref_cachefunction btrfs_free_ref_tree_range
Annotated Snippet
#ifndef BTRFS_REF_VERIFY_H
#define BTRFS_REF_VERIFY_H
#include <linux/types.h>
#include <linux/rbtree_types.h>
struct btrfs_fs_info;
struct btrfs_ref;
#ifdef CONFIG_BTRFS_DEBUG
#include <linux/spinlock.h>
int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info);
void btrfs_free_ref_cache(struct btrfs_fs_info *fs_info);
int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,
const struct btrfs_ref *generic_ref);
void btrfs_free_ref_tree_range(struct btrfs_fs_info *fs_info, u64 start,
u64 len);
static inline void btrfs_init_ref_verify(struct btrfs_fs_info *fs_info)
{
spin_lock_init(&fs_info->ref_verify_lock);
fs_info->block_tree = RB_ROOT;
}
#else
static inline int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info)
{
return 0;
}
static inline void btrfs_free_ref_cache(struct btrfs_fs_info *fs_info)
{
}
static inline int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,
const struct btrfs_ref *generic_ref)
{
return 0;
}
static inline void btrfs_free_ref_tree_range(struct btrfs_fs_info *fs_info,
u64 start, u64 len)
{
}
static inline void btrfs_init_ref_verify(struct btrfs_fs_info *fs_info)
{
}
#endif /* CONFIG_BTRFS_DEBUG */
#endif
Annotation
- Immediate include surface: `linux/types.h`, `linux/rbtree_types.h`, `linux/spinlock.h`.
- Detected declarations: `struct btrfs_fs_info`, `struct btrfs_ref`, `function btrfs_init_ref_verify`, `function btrfs_build_ref_tree`, `function btrfs_free_ref_cache`, `function btrfs_free_ref_tree_range`.
- 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.