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.

Dependency Surface

Detected Declarations

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

Implementation Notes