drivers/md/dm-core.h
Source file repositories/reference/linux-study-clean/drivers/md/dm-core.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-core.h- Extension
.h- Size
- 7611 bytes
- Lines
- 344
- Domain
- Driver Families
- Bucket
- drivers/md
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/kthread.hlinux/ktime.hlinux/blk-mq.hlinux/blk-crypto-profile.hlinux/jump_label.htrace/events/block.hdm.hdm-ima.h
Detected Declarations
struct dm_iostruct dm_kobject_holderstruct dm_md_mempoolsstruct mapped_devicestruct dm_tablestruct dm_target_iostruct dm_iofunction dm_get_sizefunction dm_emulate_zone_appendfunction dm_tio_flaggedfunction dm_tio_set_flagfunction dm_tio_is_normalfunction dm_io_flaggedfunction dm_io_set_flagfunction dm_message_test_buffer_overflow
Annotated Snippet
struct dm_kobject_holder {
struct kobject kobj;
struct completion completion;
};
/*
* DM core internal structures used directly by dm.c, dm-rq.c and dm-table.c.
* DM targets must _not_ deference a mapped_device or dm_table to directly
* access their members!
*/
/*
* For mempools pre-allocation at the table loading time.
*/
struct dm_md_mempools {
struct bio_set bs;
struct bio_set io_bs;
};
struct mapped_device {
struct mutex suspend_lock;
struct mutex table_devices_lock;
struct list_head table_devices;
/*
* The current mapping (struct dm_table *).
* Use dm_get_live_table{_fast} or take suspend_lock for
* dereference.
*/
void __rcu *map;
unsigned long flags;
/* Protect queue and type against concurrent access. */
struct mutex type_lock;
enum dm_queue_mode type;
int numa_node_id;
struct request_queue *queue;
atomic_t holders;
atomic_t open_count;
struct dm_target *immutable_target;
struct target_type *immutable_target_type;
char name[16];
struct gendisk *disk;
struct dax_device *dax_dev;
wait_queue_head_t wait;
unsigned long __percpu *pending_io;
/* forced geometry settings */
struct hd_geometry geometry;
/*
* Processing queue (flush)
*/
struct workqueue_struct *wq;
/*
* A list of ios that arrived while we were suspended.
*/
struct work_struct work;
spinlock_t deferred_lock;
struct bio_list deferred;
/*
* requeue work context is needed for cloning one new bio
* to represent the dm_io to be requeued, since each
* dm_io may point to the original bio from FS.
*/
struct work_struct requeue_work;
struct dm_io *requeue_list;
void *interface_ptr;
/*
* Event handling.
*/
wait_queue_head_t eventq;
atomic_t event_nr;
atomic_t uevent_seq;
struct list_head uevent_list;
spinlock_t uevent_lock; /* Protect access to uevent_list */
/* for blk-mq request-based DM support */
bool init_tio_pdu:1;
Annotation
- Immediate include surface: `linux/kthread.h`, `linux/ktime.h`, `linux/blk-mq.h`, `linux/blk-crypto-profile.h`, `linux/jump_label.h`, `trace/events/block.h`, `dm.h`, `dm-ima.h`.
- Detected declarations: `struct dm_io`, `struct dm_kobject_holder`, `struct dm_md_mempools`, `struct mapped_device`, `struct dm_table`, `struct dm_target_io`, `struct dm_io`, `function dm_get_size`, `function dm_emulate_zone_append`, `function dm_tio_flagged`.
- Atlas domain: Driver Families / drivers/md.
- Implementation status: source 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.