drivers/md/raid10.h
Source file repositories/reference/linux-study-clean/drivers/md/raid10.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/raid10.h- Extension
.h- Size
- 5088 bytes
- Lines
- 180
- 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
- No C-style include directives detected by the generator.
Detected Declarations
struct raid10_infostruct r10confstruct geomstruct r10biostruct r10devenum r10bio_state
Annotated Snippet
struct raid10_info {
struct md_rdev *rdev, *replacement;
sector_t head_position;
};
struct r10conf {
struct mddev *mddev;
struct raid10_info *mirrors;
struct raid10_info *mirrors_new, *mirrors_old;
spinlock_t device_lock;
/* geometry */
struct geom {
int raid_disks;
int near_copies; /* number of copies laid out
* raid0 style */
int far_copies; /* number of copies laid out
* at large strides across drives
*/
int far_offset; /* far_copies are offset by 1
* stripe instead of many
*/
sector_t stride; /* distance between far copies.
* This is size / far_copies unless
* far_offset, in which case it is
* 1 stripe.
*/
int far_set_size; /* The number of devices in a set,
* where a 'set' are devices that
* contain far/offset copies of
* each other.
*/
int chunk_shift; /* shift from chunks to sectors */
sector_t chunk_mask;
} prev, geo;
int copies; /* near_copies * far_copies.
* must be <= raid_disks
*/
sector_t dev_sectors; /* temp copy of
* mddev->dev_sectors */
sector_t reshape_progress;
sector_t reshape_safe;
unsigned long reshape_checkpoint;
sector_t offset_diff;
struct list_head retry_list;
/* A separate list of r1bio which just need raid_end_bio_io called.
* This mustn't happen for writes which had any errors if the superblock
* needs to be written.
*/
struct list_head bio_end_io_list;
/* queue pending writes and submit them on unplug */
struct bio_list pending_bio_list;
seqlock_t resync_lock;
atomic_t nr_pending;
int nr_waiting;
int nr_queued;
int barrier;
int array_freeze_pending;
sector_t next_resync;
int fullsync; /* set to 1 if a full sync is needed,
* (fresh device added).
* Cleared when a sync completes.
*/
int have_replacement; /* There is at least one
* replacement device.
*/
wait_queue_head_t wait_barrier;
mempool_t r10bio_pool;
mempool_t r10buf_pool;
struct page *tmppage;
struct bio_set bio_split;
/* When taking over an array from a different personality, we store
* the new thread here until we fully activate the array.
*/
struct md_thread __rcu *thread;
/*
* Keep track of cluster resync window to send to other nodes.
*/
sector_t cluster_sync_low;
sector_t cluster_sync_high;
};
/*
Annotation
- Detected declarations: `struct raid10_info`, `struct r10conf`, `struct geom`, `struct r10bio`, `struct r10dev`, `enum r10bio_state`.
- 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.