drivers/md/raid5.c
Source file repositories/reference/linux-study-clean/drivers/md/raid5.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/raid5.c- Extension
.c- Size
- 261809 bytes
- Lines
- 9177
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/kthread.hlinux/raid/pq.hlinux/async_tx.hlinux/module.hlinux/async.hlinux/seq_file.hlinux/cpu.hlinux/slab.hlinux/ratelimit.hlinux/nodemask.htrace/events/block.hlinux/list_sort.hmd.hraid5.hraid0.hmd-bitmap.hraid5-log.h
Detected Declarations
struct stripe_request_ctxstruct raid5_plug_cbenum stripe_resultenum reshape_locfunction stripe_hash_locks_hashfunction lock_device_hash_lockfunction unlock_device_hash_lockfunction lock_all_device_hash_locks_irqfunction unlock_all_device_hash_locks_irqfunction raid6_d0function raid6_next_diskfunction raid6_idx_to_slotfunction stripe_operations_activefunction stripe_is_lowpriofunction raid5_wakeup_stripe_threadfunction do_release_stripefunction __release_stripefunction release_inactive_stripe_listfunction release_stripe_listfunction raid5_release_stripefunction remove_hashfunction insert_hashfunction free_stripe_pagesfunction alloc_stripe_pagesfunction init_stripe_shared_pagesfunction shrink_buffersfunction grow_buffersfunction init_stripefunction raid5_runfunction has_failedfunction is_inactive_blockedfunction is_full_stripe_writefunction lock_two_stripesfunction unlock_two_stripesfunction stripe_can_batchfunction stripe_add_to_batch_listfunction use_new_offsetfunction dispatch_bio_listfunction cmp_stripefunction dispatch_defer_biosfunction flush_deferred_biosfunction defer_issue_biosfunction ops_run_iofunction async_copy_datafunction bio_for_each_segmentfunction ops_complete_biofillfunction ops_run_biofillfunction mark_target_uptodate
Annotated Snippet
module_init(raid5_init);
module_exit(raid5_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("RAID4/5/6 (striping with parity) personality for MD");
MODULE_ALIAS("md-personality-4"); /* RAID5 */
MODULE_ALIAS("md-raid5");
MODULE_ALIAS("md-raid4");
MODULE_ALIAS("md-level-5");
MODULE_ALIAS("md-level-4");
MODULE_ALIAS("md-personality-8"); /* RAID6 */
MODULE_ALIAS("md-raid6");
MODULE_ALIAS("md-level-6");
/* This used to be two separate modules, they were: */
MODULE_ALIAS("raid5");
MODULE_ALIAS("raid6");
Annotation
- Immediate include surface: `linux/blkdev.h`, `linux/kthread.h`, `linux/raid/pq.h`, `linux/async_tx.h`, `linux/module.h`, `linux/async.h`, `linux/seq_file.h`, `linux/cpu.h`.
- Detected declarations: `struct stripe_request_ctx`, `struct raid5_plug_cb`, `enum stripe_result`, `enum reshape_loc`, `function stripe_hash_locks_hash`, `function lock_device_hash_lock`, `function unlock_device_hash_lock`, `function lock_all_device_hash_locks_irq`, `function unlock_all_device_hash_locks_irq`, `function raid6_d0`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.