drivers/md/dm-ima.h
Source file repositories/reference/linux-study-clean/drivers/md/dm-ima.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-ima.h- Extension
.h- Size
- 3893 bytes
- Lines
- 119
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct dm_ima_device_table_metadatastruct dm_ima_contextstruct dm_ima_measurementsstruct dm_ima_contextenum dm_ima_table_opfunction dm_ima_init
Annotated Snippet
struct dm_ima_device_table_metadata {
/*
* Contains data specific to the device which is common across
* all the targets in the table (e.g. name, uuid, major, minor, etc).
* The values are stored in comma separated list of key1=val1,key2=val2;
* pairs delimited by a semicolon at the end of the list.
*/
char *device_metadata;
unsigned int device_metadata_len;
unsigned int num_targets;
sector_t capacity;
/*
* Contains the sha256 hashes of the IMA measurements of the target
* attributes' key-value pairs from the active/inactive tables.
*/
char *hash;
unsigned int hash_len;
};
struct dm_ima_context {
struct dm_ima_device_table_metadata table;
unsigned int update_idx;
char dev_name[DM_NAME_LEN*2];
char dev_uuid[DM_UUID_LEN*2];
};
/*
* This structure contains device metadata, and table hash for
* active and inactive tables for ima measurements.
*/
struct dm_ima_measurements {
unsigned int update_idx;
unsigned int measure_idx;
struct wait_queue_head ima_wq;
spinlock_t ima_lock;
struct dm_ima_device_table_metadata active_table;
struct dm_ima_device_table_metadata inactive_table;
};
void dm_ima_init(struct mapped_device *md);
void dm_ima_alloc_context(struct dm_ima_context **context, bool noio);
void dm_ima_free_context(struct dm_ima_context *context);
void dm_ima_context_table_op(struct mapped_device *md,
struct dm_ima_context *context,
enum dm_ima_table_op op);
void dm_ima_measure_on_table_load(struct dm_table *table,
struct dm_ima_context *context);
void dm_ima_measure_on_device_resume(struct mapped_device *md, bool swap,
struct dm_ima_context *context);
void dm_ima_measure_on_device_remove(struct mapped_device *md, bool remove_all,
struct dm_ima_context *context,
unsigned int idx);
void dm_ima_measure_on_table_clear(struct mapped_device *md,
struct dm_ima_context *context);
void dm_ima_measure_on_device_rename(struct mapped_device *md,
struct dm_ima_context *context);
#else
struct dm_ima_context;
static inline void dm_ima_init(struct mapped_device *md) {}
static inline void dm_ima_alloc_context(struct dm_ima_context **context, bool noio) {}
static inline void dm_ima_free_context(struct dm_ima_context *context) {}
static inline void dm_ima_context_table_op(struct mapped_device *md,
struct dm_ima_context *context,
enum dm_ima_table_op op) {}
static inline void dm_ima_measure_on_table_load(struct dm_table *table,
struct dm_ima_context *context) {}
static inline void dm_ima_measure_on_device_resume(struct mapped_device *md,
bool swap,
struct dm_ima_context *context) {}
static inline void dm_ima_measure_on_device_remove(struct mapped_device *md,
bool remove_all,
struct dm_ima_context *context,
unsigned int idx) {}
static inline void dm_ima_measure_on_table_clear(struct mapped_device *md,
struct dm_ima_context *context) {}
static inline void dm_ima_measure_on_device_rename(struct mapped_device *md,
struct dm_ima_context *context) {}
#endif /* CONFIG_IMA */
#endif /* DM_IMA_H */
Annotation
- Detected declarations: `struct dm_ima_device_table_metadata`, `struct dm_ima_context`, `struct dm_ima_measurements`, `struct dm_ima_context`, `enum dm_ima_table_op`, `function dm_ima_init`.
- Atlas domain: Driver Families / drivers/md.
- Implementation status: source implementation candidate.
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.