fs/autofs/dev-ioctl.c
Source file repositories/reference/linux-study-clean/fs/autofs/dev-ioctl.c
File Facts
- System
- Linux kernel
- Corpus path
fs/autofs/dev-ioctl.c- Extension
.c- Size
- 20935 bytes
- Lines
- 811
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/module.hlinux/miscdevice.hlinux/compat.hlinux/fdtable.hlinux/magic.hlinux/nospec.hautofs_i.h
Detected Declarations
function check_namefunction invalid_strfunction check_dev_ioctl_versionfunction copy_dev_ioctlfunction free_dev_ioctlfunction validate_dev_ioctlfunction autofs_dev_ioctl_versionfunction autofs_dev_ioctl_protoverfunction autofs_dev_ioctl_protosubverfunction find_autofs_mountfunction test_by_devfunction test_by_typefunction numberfunction autofs_dev_ioctl_openmountfunction autofs_dev_ioctl_closemountfunction autofs_dev_ioctl_readyfunction autofs_dev_ioctl_failfunction processfunction autofs_dev_ioctl_catatonicfunction autofs_dev_ioctl_timeoutfunction gidfunction autofs_dev_ioctl_expirefunction autofs_dev_ioctl_askumountfunction numberfunction _IOC_NRfunction _autofs_dev_ioctlfunction autofs_dev_ioctlfunction autofs_dev_ioctl_compatfunction autofs_dev_ioctl_initfunction autofs_dev_ioctl_exit
Annotated Snippet
static const struct file_operations _dev_ioctl_fops = {
.unlocked_ioctl = autofs_dev_ioctl,
.compat_ioctl = autofs_dev_ioctl_compat,
.owner = THIS_MODULE,
.llseek = noop_llseek,
};
static struct miscdevice _autofs_dev_ioctl_misc = {
.minor = AUTOFS_MINOR,
.name = AUTOFS_DEVICE_NAME,
.fops = &_dev_ioctl_fops,
.mode = 0644,
};
MODULE_ALIAS_MISCDEV(AUTOFS_MINOR);
MODULE_ALIAS("devname:autofs");
/* Register/deregister misc character device */
int __init autofs_dev_ioctl_init(void)
{
int r;
r = misc_register(&_autofs_dev_ioctl_misc);
if (r) {
pr_err("misc_register failed for control device\n");
return r;
}
return 0;
}
void autofs_dev_ioctl_exit(void)
{
misc_deregister(&_autofs_dev_ioctl_misc);
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/miscdevice.h`, `linux/compat.h`, `linux/fdtable.h`, `linux/magic.h`, `linux/nospec.h`, `autofs_i.h`.
- Detected declarations: `function check_name`, `function invalid_str`, `function check_dev_ioctl_version`, `function copy_dev_ioctl`, `function free_dev_ioctl`, `function validate_dev_ioctl`, `function autofs_dev_ioctl_version`, `function autofs_dev_ioctl_protover`, `function autofs_dev_ioctl_protosubver`, `function find_autofs_mount`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.