fs/kernfs/dir.c
Source file repositories/reference/linux-study-clean/fs/kernfs/dir.c
File Facts
- System
- Linux kernel
- Corpus path
fs/kernfs/dir.c- Extension
.c- Size
- 53482 bytes
- Lines
- 2016
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/sched.hlinux/fs.hlinux/namei.hlinux/idr.hlinux/slab.hlinux/security.hlinux/hash.hlinux/ns_common.hkernfs-internal.h
Detected Declarations
function __kernfs_activefunction kernfs_activefunction kernfs_lockdepfunction kernfs_depthfunction kernfs_path_from_node_lockedfunction strscpyfunction pathfunction pr_cont_kernfs_namefunction pr_cont_kernfs_pathfunction kernfs_ns_idfunction kernfs_name_hashfunction kernfs_name_comparefunction kernfs_sd_comparefunction kernfs_link_siblingfunction kernfs_unlink_siblingfunction kernfs_put_activefunction kernfs_drainfunction kernfs_getfunction kernfs_free_rcufunction kernfs_putfunction kernfs_add_onefunction kernfs_root_flagsfunction kernfs_destroy_rootfunction kernfs_dop_revalidatefunction kernfs_iop_rmdirfunction kernfs_iop_renamefunction kernfs_activate_onefunction kernfs_activatefunction kernfs_showfunction filesfunction list_for_each_entryfunction __kernfs_removefunction kernfs_unlink_siblingfunction kernfs_removefunction kernfs_unbreak_active_protectionfunction kernfs_break_active_protectionfunction kernfs_remove_selffunction kernfs_remove_selffunction kernfs_remove_by_name_nsfunction kernfs_rename_nsfunction kernfs_dir_fop_releasefunction kernfs_ns_idfunction kernfs_fop_readdirexport kernfs_path_from_nodeexport kernfs_getexport kernfs_putexport kernfs_find_and_get_ns
Annotated Snippet
const struct file_operations kernfs_dir_fops = {
.read = generic_read_dir,
.iterate_shared = kernfs_fop_readdir,
.release = kernfs_dir_fop_release,
.llseek = generic_file_llseek,
};
Annotation
- Immediate include surface: `linux/sched.h`, `linux/fs.h`, `linux/namei.h`, `linux/idr.h`, `linux/slab.h`, `linux/security.h`, `linux/hash.h`, `linux/ns_common.h`.
- Detected declarations: `function __kernfs_active`, `function kernfs_active`, `function kernfs_lockdep`, `function kernfs_depth`, `function kernfs_path_from_node_locked`, `function strscpy`, `function path`, `function pr_cont_kernfs_name`, `function pr_cont_kernfs_path`, `function kernfs_ns_id`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: pattern 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.