drivers/scsi/sr.c
Source file repositories/reference/linux-study-clean/drivers/scsi/sr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/sr.c- Extension
.c- Size
- 25801 bytes
- Lines
- 1012
- Domain
- Driver Families
- Bucket
- drivers/scsi
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/module.hlinux/fs.hlinux/kernel.hlinux/mm.hlinux/bio.hlinux/compat.hlinux/string.hlinux/errno.hlinux/cdrom.hlinux/interrupt.hlinux/init.hlinux/major.hlinux/blkdev.hlinux/blk-pm.hlinux/mutex.hlinux/slab.hlinux/pm_runtime.hlinux/uaccess.hlinux/unaligned.hscsi/scsi.hscsi/scsi_dbg.hscsi/scsi_device.hscsi/scsi_driver.hscsi/scsi_cmnd.hscsi/scsi_eh.hscsi/scsi_host.hscsi/scsi_ioctl.hscsi_logging.hsr.h
Detected Declarations
function sr_runtime_suspendfunction sr_get_eventsfunction sr_check_eventsfunction openfunction sr_donefunction sr_init_commandfunction sr_revalidate_diskfunction sr_block_openfunction sr_block_releasefunction sr_block_ioctlfunction sr_block_check_eventsfunction sr_free_diskfunction sr_openfunction sr_releasefunction get_sectorsizefunction get_capabilitiesfunction sr_packetfunction sr_read_cdda_bpcfunction sr_removefunction init_srfunction exit_srmodule init init_sr
Annotated Snippet
module_init(init_sr);
module_exit(exit_sr);
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/module.h`, `linux/fs.h`, `linux/kernel.h`, `linux/mm.h`, `linux/bio.h`, `linux/compat.h`, `linux/string.h`, `linux/errno.h`.
- Detected declarations: `function sr_runtime_suspend`, `function sr_get_events`, `function sr_check_events`, `function open`, `function sr_done`, `function sr_init_command`, `function sr_revalidate_disk`, `function sr_block_open`, `function sr_block_release`, `function sr_block_ioctl`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: integration 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.