drivers/md/dm.c
Source file repositories/reference/linux-study-clean/drivers/md/dm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm.c- Extension
.c- Size
- 92399 bytes
- Lines
- 3840
- Domain
- Driver Families
- Bucket
- drivers/md
- 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
dm-core.hdm-rq.hdm-uevent.hdm-ima.hlinux/bio-integrity.hlinux/init.hlinux/module.hlinux/mutex.hlinux/sched/mm.hlinux/sched/signal.hlinux/blkpg.hlinux/bio.hlinux/mempool.hlinux/dax.hlinux/slab.hlinux/idr.hlinux/uio.hlinux/hdreg.hlinux/delay.hlinux/wait.hlinux/pr.hlinux/refcount.hlinux/part_stat.hlinux/blk-crypto.hlinux/blk-crypto-profile.h
Detected Declarations
struct clone_infostruct table_devicestruct dm_blkdev_idstruct dm_prfunction dm_issue_global_eventfunction dm_bio_get_target_bio_nrfunction get_swap_biosfunction __dm_get_module_param_intfunction __dm_get_module_paramfunction dm_get_reserved_bio_based_iosfunction dm_get_numa_nodefunction local_initfunction local_exitfunction dm_initfunction dm_exitfunction dm_deleting_mdfunction dm_blk_openfunction dm_blk_closefunction dm_open_countfunction dm_lock_for_deletionfunction dm_cancel_deferred_removefunction do_deferred_removefunction dm_blk_getgeofunction dm_prepare_ioctlfunction dm_unprepare_ioctlfunction dm_blk_ioctlfunction dm_start_time_ns_from_clonefunction dm_io_sectorsfunction dm_io_acctfunction __dm_start_io_acctfunction dm_start_io_acctfunction dm_end_io_acctfunction free_iofunction free_tiofunction queue_iofunction Everyonefunction dm_put_live_tablefunction dm_sync_tablefunction dm_put_live_table_fastfunction close_table_devicefunction dm_get_table_devicefunction dm_put_table_devicefunction dm_get_geometryfunction dm_set_geometryfunction __noflush_suspendingfunction dm_requeue_add_iofunction dm_kick_requeuefunction dm_handle_requeue
Annotated Snippet
module_init(dm_init);
module_exit(dm_exit);
module_param(major, uint, 0);
MODULE_PARM_DESC(major, "The major number of the device mapper");
module_param(reserved_bio_based_ios, uint, 0644);
MODULE_PARM_DESC(reserved_bio_based_ios, "Reserved IOs in bio-based mempools");
module_param(dm_numa_node, int, 0644);
MODULE_PARM_DESC(dm_numa_node, "NUMA node for DM device memory allocations");
module_param(swap_bios, int, 0644);
MODULE_PARM_DESC(swap_bios, "Maximum allowed inflight swap IOs");
MODULE_DESCRIPTION(DM_NAME " driver");
MODULE_AUTHOR("Joe Thornber <dm-devel@lists.linux.dev>");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `dm-core.h`, `dm-rq.h`, `dm-uevent.h`, `dm-ima.h`, `linux/bio-integrity.h`, `linux/init.h`, `linux/module.h`, `linux/mutex.h`.
- Detected declarations: `struct clone_info`, `struct table_device`, `struct dm_blkdev_id`, `struct dm_pr`, `function dm_issue_global_event`, `function dm_bio_get_target_bio_nr`, `function get_swap_bios`, `function __dm_get_module_param_int`, `function __dm_get_module_param`, `function dm_get_reserved_bio_based_ios`.
- Atlas domain: Driver Families / drivers/md.
- 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.