fs/kernfs/kernfs-internal.h
Source file repositories/reference/linux-study-clean/fs/kernfs/kernfs-internal.h
File Facts
- System
- Linux kernel
- Corpus path
fs/kernfs/kernfs-internal.h- Extension
.h- Size
- 6509 bytes
- Lines
- 237
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/lockdep.hlinux/fs.hlinux/mutex.hlinux/rwsem.hlinux/xattr.hlinux/kernfs.hlinux/fs_context.h
Detected Declarations
struct kernfs_iattrsstruct kernfs_rootstruct kernfs_super_infofunction kernfs_root_is_lockedfunction kernfs_rename_is_lockedfunction kernfs_set_revfunction kernfs_inc_revfunction kernfs_dir_changed
Annotated Snippet
extern const struct file_operations kernfs_dir_fops;
extern const struct inode_operations kernfs_dir_iops;
struct kernfs_node *kernfs_get_active(struct kernfs_node *kn);
void kernfs_put_active(struct kernfs_node *kn);
int kernfs_add_one(struct kernfs_node *kn);
struct kernfs_node *kernfs_new_node(struct kernfs_node *parent,
const char *name, umode_t mode,
kuid_t uid, kgid_t gid,
unsigned flags);
/*
* file.c
*/
extern const struct file_operations kernfs_file_fops;
bool kernfs_should_drain_open_files(struct kernfs_node *kn);
void kernfs_drain_open_files(struct kernfs_node *kn);
/*
* symlink.c
*/
extern const struct inode_operations kernfs_symlink_iops;
/*
* kernfs locks
*/
extern struct kernfs_global_locks *kernfs_locks;
/* Hashed mutex helpers - protect per-node data structures */
static inline struct mutex *kernfs_node_lock_ptr(struct kernfs_node *kn)
{
int idx = hash_ptr(kn, NR_KERNFS_LOCK_BITS);
return &kernfs_locks->node_mutex[idx];
}
static inline struct mutex *kernfs_node_lock(struct kernfs_node *kn)
{
struct mutex *lock = kernfs_node_lock_ptr(kn);
mutex_lock(lock);
return lock;
}
DEFINE_CLASS(kernfs_node_lock, struct mutex *,
mutex_unlock(_T), kernfs_node_lock(kn), struct kernfs_node *kn)
#endif /* __KERNFS_INTERNAL_H */
Annotation
- Immediate include surface: `linux/lockdep.h`, `linux/fs.h`, `linux/mutex.h`, `linux/rwsem.h`, `linux/xattr.h`, `linux/kernfs.h`, `linux/fs_context.h`.
- Detected declarations: `struct kernfs_iattrs`, `struct kernfs_root`, `struct kernfs_super_info`, `function kernfs_root_is_locked`, `function kernfs_rename_is_locked`, `function kernfs_set_rev`, `function kernfs_inc_rev`, `function kernfs_dir_changed`.
- 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.