drivers/md/raid1.c
Source file repositories/reference/linux-study-clean/drivers/md/raid1.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/raid1.c- Extension
.c- Size
- 95735 bytes
- Lines
- 3523
- 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/slab.hlinux/delay.hlinux/blkdev.hlinux/module.hlinux/seq_file.hlinux/ratelimit.hlinux/interval_tree_generic.htrace/events/block.hmd.hraid1.hmd-bitmap.hmd-cluster.hraid1-10.c
Detected Declarations
struct read_balance_ctlfunction check_and_add_serialfunction wait_for_serializationfunction remove_serialfunction r1buf_pool_allocfunction r1buf_pool_freefunction put_all_biosfunction free_r1biofunction put_buffunction reschedule_retryfunction raid_end_bio_iofunction raid_end_bio_iofunction update_head_posfunction find_bio_diskfunction raid1_end_read_requestfunction test_bitfunction close_writefunction r1_bio_write_donefunction raid1_end_write_requestfunction align_to_barrier_unit_endfunction update_read_sectorsfunction choose_first_rdevfunction rdev_in_recoveryfunction choose_bb_rdevfunction choose_slow_rdevfunction is_sequentialfunction should_choose_nextfunction rdev_readablefunction choose_best_rdevfunction read_balancefunction wake_up_barrierfunction flush_bio_listfunction flush_pending_writesfunction raise_barrierfunction lower_barrierfunction _wait_barrierfunction wait_read_barrierfunction wait_barrierfunction _allow_barrierfunction allow_barrierfunction get_unqueued_pendingfunction freeze_arrayfunction unfreeze_arrayfunction alloc_behind_master_biofunction raid1_unplugfunction init_r1biofunction alloc_r1biofunction raid1_read_request
Annotated Snippet
module_init(raid1_init);
module_exit(raid1_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("RAID1 (mirroring) personality for MD");
MODULE_ALIAS("md-personality-3"); /* RAID1 */
MODULE_ALIAS("md-raid1");
MODULE_ALIAS("md-level-1");
Annotation
- Immediate include surface: `linux/slab.h`, `linux/delay.h`, `linux/blkdev.h`, `linux/module.h`, `linux/seq_file.h`, `linux/ratelimit.h`, `linux/interval_tree_generic.h`, `trace/events/block.h`.
- Detected declarations: `struct read_balance_ctl`, `function check_and_add_serial`, `function wait_for_serialization`, `function remove_serial`, `function r1buf_pool_alloc`, `function r1buf_pool_free`, `function put_all_bios`, `function free_r1bio`, `function put_buf`, `function reschedule_retry`.
- 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.