fs/orangefs/devorangefs-req.c
Source file repositories/reference/linux-study-clean/fs/orangefs/devorangefs-req.c
File Facts
- System
- Linux kernel
- Corpus path
fs/orangefs/devorangefs-req.c- Extension
.c- Size
- 22416 bytes
- Lines
- 815
- 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
protocol.horangefs-kernel.horangefs-dev-proto.horangefs-bufmap.horangefs-debugfs.hlinux/debugfs.hlinux/slab.h
Detected Declarations
struct ORANGEFS_dev_map_desc32function hash_funcfunction orangefs_devreq_add_opfunction mark_all_pending_mountsfunction fs_mount_pendingfunction orangefs_devreq_openfunction orangefs_devreq_readfunction writevfunction orangefs_devreq_releasefunction is_daemon_in_servicefunction __is_daemon_in_servicefunction check_ioctl_commandfunction dispatch_ioctl_commandfunction list_for_each_entryfunction orangefs_devreq_ioctlfunction orangefs_devreq_compat_ioctlfunction orangefs_devreq_pollfunction orangefs_dev_initfunction orangefs_dev_cleanup
Annotated Snippet
static const struct file_operations orangefs_devreq_file_operations = {
.owner = THIS_MODULE,
.read = orangefs_devreq_read,
.write_iter = orangefs_devreq_write_iter,
.open = orangefs_devreq_open,
.release = orangefs_devreq_release,
.unlocked_ioctl = orangefs_devreq_ioctl,
#ifdef CONFIG_COMPAT /* CONFIG_COMPAT is in .config */
.compat_ioctl = orangefs_devreq_compat_ioctl,
#endif
.poll = orangefs_devreq_poll
};
/*
* Initialize orangefs device specific state:
* Must be called at module load time only
*/
int orangefs_dev_init(void)
{
/* register orangefs-req device */
orangefs_dev_major = register_chrdev(0,
ORANGEFS_REQDEVICE_NAME,
&orangefs_devreq_file_operations);
if (orangefs_dev_major < 0) {
gossip_debug(GOSSIP_DEV_DEBUG,
"Failed to register /dev/%s (error %d)\n",
ORANGEFS_REQDEVICE_NAME, orangefs_dev_major);
return orangefs_dev_major;
}
gossip_debug(GOSSIP_DEV_DEBUG,
"*** /dev/%s character device registered ***\n",
ORANGEFS_REQDEVICE_NAME);
gossip_debug(GOSSIP_DEV_DEBUG, "'mknod /dev/%s c %d 0'.\n",
ORANGEFS_REQDEVICE_NAME, orangefs_dev_major);
return 0;
}
void orangefs_dev_cleanup(void)
{
unregister_chrdev(orangefs_dev_major, ORANGEFS_REQDEVICE_NAME);
gossip_debug(GOSSIP_DEV_DEBUG,
"*** /dev/%s character device unregistered ***\n",
ORANGEFS_REQDEVICE_NAME);
}
Annotation
- Immediate include surface: `protocol.h`, `orangefs-kernel.h`, `orangefs-dev-proto.h`, `orangefs-bufmap.h`, `orangefs-debugfs.h`, `linux/debugfs.h`, `linux/slab.h`.
- Detected declarations: `struct ORANGEFS_dev_map_desc32`, `function hash_func`, `function orangefs_devreq_add_op`, `function mark_all_pending_mounts`, `function fs_mount_pending`, `function orangefs_devreq_open`, `function orangefs_devreq_read`, `function writev`, `function orangefs_devreq_release`, `function is_daemon_in_service`.
- 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.