/* Note: raid1_info.rdev can be set to NULL asynchronously by raid1_remove_disk. *Therearethreesafewaystoaccessraid1_info.rdev. *1/whenholdingmddev->reconfig_mutex *2/whenresync/recoveryisknowntobehappening-i.e.incodethatis *calledaspartofperformingresync/recovery. *3/whileholdingrcu_read_lock(),usercu_dereferencetogetthepointer *andifitisnon-NULL,incrementrdev->nr_pendingbeforedroppingthe *RCUlock. *When.rdevissettoNULL,thenr_pendingcountcheckedagainandifithas *beenincremented,thepointerisputbackin.rdev.
*/
/* When choose the best device for a read (read_balance()) *wetrytokeepsequentialreadsonethesamedevice
*/
sector_t next_seq_sect;
sector_t seq_start;
};
struct r1conf { struct mddev *mddev; struct raid1_info *mirrors; /* twice 'raid_disks' to *allowforreplacements.
*/ int raid_disks; int nonrot_disks;
spinlock_t device_lock;
/* list of 'struct r1bio' that need to be processed by raid1d, *whethertoretryaread,writeoutaresyncorrecovery *block,oranythingelse.
*/ struct list_head retry_list; /* A separate list of r1bio which just need raid_end_bio_io called. *Thismustn'thappenforwriteswhichhadanyerrorsifthesuperblock *needstobewritten.
*/ struct list_head bio_end_io_list;
/* queue pending writes to be submitted on unplug */ struct bio_list pending_bio_list;
/* for use when syncing mirrors: *Wedon'tallowbothnormalIOandresync/recoveryIOat *thesametime-resync/recoverycanonlyhappenwhenthere *isnootherIO.Sowheneitherisactive,theotherhastowait. *Seemoredetailsdescriptioninraid1.cnearraise_barrier().
*/
wait_queue_head_t wait_barrier;
spinlock_t resync_lock;
atomic_t nr_sync_pending;
atomic_t *nr_pending;
atomic_t *nr_waiting;
atomic_t *nr_queued;
atomic_t *barrier; int array_frozen;
/* Set to 1 if a full sync is needed, (fresh device added). *Clearedwhenasynccompletes.
*/ int fullsync;
/* When the same as mddev->recovery_disabled we don't allow *recoverytobeattemptedasweexpectareaderror.
*/ int recovery_disabled;
mempool_t *r1bio_pool;
mempool_t r1buf_pool;
struct bio_set bio_split;
/* temporary buffer to synchronous IO when attempting to repair *areaderror.
*/ struct page *tmppage;
/* When taking over an array from a different personality, we store *thenewthreadhereuntilwefullyactivatethearray.
*/ 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;
struct r1bio {
atomic_t remaining; /* 'have we finished' count, *usedfromIRQhandlers
*/
atomic_t behind_remaining; /* number of write-behind ios remaining *inthisBehindIOrequest
*/
sector_t sector; int sectors; unsignedlong state; struct mddev *mddev; /* *originalbiogoingto/dev/mdx
*/ struct bio *master_bio; /* *iftheIOisinREADdirection,thenthisiswhereweread
*/ int read_disk;
struct list_head retry_list;
/* *WhenR1BIO_BehindIOisset,westorepagesforwritebehind *inbehind_master_bio.
*/ struct bio *behind_master_bio;
/* *iftheIOisinWRITEdirection,thenmultiplebiosareused. *Wechoosethenumberwhentheyareallocated.
*/ struct bio *bios[]; /* DO NOT PUT ANY NEW FIELDS HERE - bios array is contiguously alloced*/
};
/* bits for r1bio.state */ enum r1bio_state {
R1BIO_Uptodate,
R1BIO_IsSync,
R1BIO_BehindIO, /* Set ReadError on bios that experience a readerror so that *raid1dknowswhattodowiththem.
*/
R1BIO_ReadError, /* For write-behind requests, we call bi_end_io when *thelastnon-write-behinddevicecompletes,providing *anywritewassuccessful.Otherwisewecallwhen *anywrite-behindwritesucceeds,otherwisewecall *withfailurewhenlastwritecompletes(andallfailed). *Recordthatbi_end_iowascalledwiththisflag...
*/
R1BIO_Returned, /* If a write for this request means we can clear some *known-bad-blockrecords,wesetthisflag
*/
R1BIO_MadeGood,
R1BIO_WriteError,
R1BIO_FailFast,
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.