drivers/md/dm-snap.c
Source file repositories/reference/linux-study-clean/drivers/md/dm-snap.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-snap.c- Extension
.c- Size
- 69270 bytes
- Lines
- 2858
- 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
linux/blkdev.hlinux/device-mapper.hlinux/delay.hlinux/fs.hlinux/init.hlinux/kdev_t.hlinux/list.hlinux/list_bl.hlinux/mempool.hlinux/module.hlinux/slab.hlinux/vmalloc.hlinux/log2.hlinux/dm-kcopyd.hdm.hdm-exception-store.h
Detected Declarations
struct dm_hlist_headstruct dm_exception_tablestruct dm_snapshotstruct dm_snap_pending_exceptionstruct dm_snap_tracked_chunkstruct originstruct dm_originstruct dm_exception_table_lockfunction chunk_to_sectorfunction bdev_equalfunction init_tracked_chunkfunction is_bio_trackedfunction track_chunkfunction stop_tracking_chunkfunction __chunk_is_trackedfunction hlist_for_each_entryfunction fsleepfunction init_origin_hashfunction exit_origin_hashfunction origin_hashfunction __insert_originfunction __insert_dm_originfunction __remove_dm_originfunction __find_snapshots_sharing_cowfunction list_for_each_entryfunction __validate_exception_handoverfunction __insert_snapshotfunction register_snapshotfunction reregister_snapshotfunction unregister_snapshotfunction dm_exception_table_lock_initfunction dm_exception_table_lockfunction dm_exception_table_unlockfunction dm_exception_table_initfunction dm_exception_table_exitfunction hlist_for_each_entry_safefunction exception_hashfunction dm_remove_exceptionfunction free_completed_exceptionfunction free_pending_exceptionfunction dm_insert_exceptionfunction dm_add_exceptionfunction __minimum_chunk_sizefunction calc_max_bucketsfunction init_hash_tablesfunction merge_shutdownfunction __remove_single_exception_chunkfunction dm_consecutive_chunk_count
Annotated Snippet
module_init(dm_snapshot_init);
module_exit(dm_snapshot_exit);
MODULE_DESCRIPTION(DM_NAME " snapshot target");
MODULE_AUTHOR("Joe Thornber");
MODULE_LICENSE("GPL");
MODULE_ALIAS("dm-snapshot-origin");
MODULE_ALIAS("dm-snapshot-merge");
Annotation
- Immediate include surface: `linux/blkdev.h`, `linux/device-mapper.h`, `linux/delay.h`, `linux/fs.h`, `linux/init.h`, `linux/kdev_t.h`, `linux/list.h`, `linux/list_bl.h`.
- Detected declarations: `struct dm_hlist_head`, `struct dm_exception_table`, `struct dm_snapshot`, `struct dm_snap_pending_exception`, `struct dm_snap_tracked_chunk`, `struct origin`, `struct dm_origin`, `struct dm_exception_table_lock`, `function chunk_to_sector`, `function bdev_equal`.
- 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.