include/linux/btree-type.h
Source file repositories/reference/linux-study-clean/include/linux/btree-type.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/btree-type.h- Extension
.h- Size
- 3991 bytes
- Lines
- 149
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- 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
function BTREE_FNfunction BTREE_FNfunction BTREE_FNfunction BTREE_FNfunction BTREE_FNfunction BTREE_FNfunction BTREE_FNfunction BTREE_FNfunction BTREE_FNfunction BTREE_FN
Annotated Snippet
#define __BTREE_TP(pfx, type, sfx) pfx ## type ## sfx
#define _BTREE_TP(pfx, type, sfx) __BTREE_TP(pfx, type, sfx)
#define BTREE_TP(pfx) _BTREE_TP(pfx, BTREE_TYPE_SUFFIX,)
#define BTREE_FN(name) BTREE_TP(btree_ ## name)
#define BTREE_TYPE_HEAD BTREE_TP(struct btree_head)
#define VISITOR_FN BTREE_TP(visitor)
#define VISITOR_FN_T _BTREE_TP(visitor, BTREE_TYPE_SUFFIX, _t)
BTREE_TYPE_HEAD {
struct btree_head h;
};
static inline void BTREE_FN(init_mempool)(BTREE_TYPE_HEAD *head,
mempool_t *mempool)
{
btree_init_mempool(&head->h, mempool);
}
static inline int BTREE_FN(init)(BTREE_TYPE_HEAD *head)
{
return btree_init(&head->h);
}
static inline void BTREE_FN(destroy)(BTREE_TYPE_HEAD *head)
{
btree_destroy(&head->h);
}
static inline int BTREE_FN(merge)(BTREE_TYPE_HEAD *target,
BTREE_TYPE_HEAD *victim,
gfp_t gfp)
{
return btree_merge(&target->h, &victim->h, BTREE_TYPE_GEO, gfp);
}
#if (BITS_PER_LONG > BTREE_TYPE_BITS)
static inline void *BTREE_FN(lookup)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key)
{
unsigned long _key = key;
return btree_lookup(&head->h, BTREE_TYPE_GEO, &_key);
}
static inline int BTREE_FN(insert)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key,
void *val, gfp_t gfp)
{
unsigned long _key = key;
return btree_insert(&head->h, BTREE_TYPE_GEO, &_key, val, gfp);
}
static inline int BTREE_FN(update)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key,
void *val)
{
unsigned long _key = key;
return btree_update(&head->h, BTREE_TYPE_GEO, &_key, val);
}
static inline void *BTREE_FN(remove)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key)
{
unsigned long _key = key;
return btree_remove(&head->h, BTREE_TYPE_GEO, &_key);
}
static inline void *BTREE_FN(last)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE *key)
{
unsigned long _key;
void *val = btree_last(&head->h, BTREE_TYPE_GEO, &_key);
if (val)
*key = _key;
return val;
}
static inline void *BTREE_FN(get_prev)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE *key)
{
unsigned long _key = *key;
void *val = btree_get_prev(&head->h, BTREE_TYPE_GEO, &_key);
if (val)
*key = _key;
return val;
}
#else
static inline void *BTREE_FN(lookup)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key)
{
return btree_lookup(&head->h, BTREE_TYPE_GEO, (unsigned long *)&key);
}
static inline int BTREE_FN(insert)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key,
void *val, gfp_t gfp)
{
return btree_insert(&head->h, BTREE_TYPE_GEO, (unsigned long *)&key,
val, gfp);
Annotation
- Detected declarations: `function BTREE_FN`, `function BTREE_FN`, `function BTREE_FN`, `function BTREE_FN`, `function BTREE_FN`, `function BTREE_FN`, `function BTREE_FN`, `function BTREE_FN`, `function BTREE_FN`, `function BTREE_FN`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.