fs/btrfs/accessors.c
Source file repositories/reference/linux-study-clean/fs/btrfs/accessors.c
File Facts
- System
- Linux kernel
- Corpus path
fs/btrfs/accessors.c- Extension
.c- Size
- 4350 bytes
- Lines
- 126
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/unaligned.hmessages.hextent_io.hfs.haccessors.h
Detected Declarations
function Copyrightfunction memcpy_split_srcfunction likelyfunction btrfs_node_key
Annotated Snippet
likely(sizeof(u##bits) <= part)) { \
put_unaligned_le##bits(val, kaddr); \
return; \
} \
put_unaligned_le##bits(val, lebytes); \
if (sizeof(u##bits) == 2) { \
*kaddr = lebytes[0]; \
kaddr = folio_address(eb->folios[idx + 1]); \
*kaddr = lebytes[1]; \
} else { \
memcpy(kaddr, lebytes, part); \
kaddr = folio_address(eb->folios[idx + 1]); \
memcpy(kaddr, lebytes + part, sizeof(u##bits) - part); \
} \
}
DEFINE_BTRFS_SETGET_BITS(8)
DEFINE_BTRFS_SETGET_BITS(16)
DEFINE_BTRFS_SETGET_BITS(32)
DEFINE_BTRFS_SETGET_BITS(64)
void btrfs_node_key(const struct extent_buffer *eb,
struct btrfs_disk_key *disk_key, int nr)
{
unsigned long ptr = btrfs_node_key_ptr_offset(eb, nr);
read_eb_member(eb, (struct btrfs_key_ptr *)ptr,
struct btrfs_key_ptr, key, disk_key);
}
Annotation
- Immediate include surface: `linux/unaligned.h`, `messages.h`, `extent_io.h`, `fs.h`, `accessors.h`.
- Detected declarations: `function Copyright`, `function memcpy_split_src`, `function likely`, `function btrfs_node_key`.
- 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.