include/linux/ns/nstree_types.h
Source file repositories/reference/linux-study-clean/include/linux/ns/nstree_types.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/ns/nstree_types.h- Extension
.h- Size
- 1758 bytes
- Lines
- 56
- 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.
- 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/rbtree.hlinux/list.h
Detected Declarations
struct ns_tree_rootstruct ns_tree_nodestruct ns_tree
Annotated Snippet
struct ns_tree_root {
struct rb_root ns_rb;
struct list_head ns_list_head;
};
/**
* struct ns_tree_node - Node in a namespace tree
* @ns_node: Red-black tree node
* @ns_list_entry: List entry for sequential iteration
*
* Represents a namespace's position in a tree. Each namespace has
* multiple tree nodes for different trees (unified, per-type, owner).
*/
struct ns_tree_node {
struct rb_node ns_node;
struct list_head ns_list_entry;
};
/**
* struct ns_tree - Namespace tree nodes and active reference count
* @ns_id: Unique namespace identifier
* @__ns_ref_active: Active reference count (do not use directly)
* @ns_unified_node: Node in the global namespace tree
* @ns_tree_node: Node in the per-type namespace tree
* @ns_owner_node: Node in the owner namespace's tree of owned namespaces
* @ns_owner_root: Root of the tree of namespaces owned by this namespace
* (only used when this namespace is an owner)
*/
struct ns_tree {
u64 ns_id;
atomic_t __ns_ref_active;
struct ns_tree_node ns_unified_node;
struct ns_tree_node ns_tree_node;
struct ns_tree_node ns_owner_node;
struct ns_tree_root ns_owner_root;
};
#endif /* _LINUX_NSTREE_TYPES_H */
Annotation
- Immediate include surface: `linux/rbtree.h`, `linux/list.h`.
- Detected declarations: `struct ns_tree_root`, `struct ns_tree_node`, `struct ns_tree`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.