diff options
author | NeilBrown <neilb@suse.de> | 2011-10-06 23:22:33 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-10-06 23:22:33 -0400 |
commit | ce550c2059a67ee7834fc6f64cf895391d36a58e (patch) | |
tree | 55d73447b2d75597802955559706a17feda9ce68 /drivers/md/raid1.h | |
parent | 2dba6a911c284603d2085fec1e2d3c142f58a010 (diff) |
md/raid1: add documentation to r1_private_data_s data structure.
There wasn't much and it is inconsistent.
Also rearrange fields to keep related fields together.
Reported-by: Aapo Laine <aapo.laine@shiftmail.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid1.h')
-rw-r--r-- | drivers/md/raid1.h | 59 |
1 files changed, 42 insertions, 17 deletions
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h index e0d676b48974..a3d5483873a2 100644 --- a/drivers/md/raid1.h +++ b/drivers/md/raid1.h | |||
@@ -28,42 +28,67 @@ struct r1_private_data_s { | |||
28 | mddev_t *mddev; | 28 | mddev_t *mddev; |
29 | mirror_info_t *mirrors; | 29 | mirror_info_t *mirrors; |
30 | int raid_disks; | 30 | int raid_disks; |
31 | |||
32 | /* When choose the best device for a read (read_balance()) | ||
33 | * we try to keep sequential reads one the same device | ||
34 | * using 'last_used' and 'next_seq_sect' | ||
35 | */ | ||
31 | int last_used; | 36 | int last_used; |
32 | sector_t next_seq_sect; | 37 | sector_t next_seq_sect; |
38 | /* During resync, read_balancing is only allowed on the part | ||
39 | * of the array that has been resynced. 'next_resync' tells us | ||
40 | * where that is. | ||
41 | */ | ||
42 | sector_t next_resync; | ||
43 | |||
33 | spinlock_t device_lock; | 44 | spinlock_t device_lock; |
34 | 45 | ||
46 | /* list of 'r1bio_t' that need to be processed by raid1d, whether | ||
47 | * to retry a read, writeout a resync or recovery block, or | ||
48 | * anything else. | ||
49 | */ | ||
35 | struct list_head retry_list; | 50 | struct list_head retry_list; |
36 | /* queue pending writes and submit them on unplug */ | ||
37 | struct bio_list pending_bio_list; | ||
38 | 51 | ||
39 | /* for use when syncing mirrors: */ | 52 | /* queue pending writes to be submitted on unplug */ |
53 | struct bio_list pending_bio_list; | ||
40 | 54 | ||
55 | /* for use when syncing mirrors: | ||
56 | * We don't allow both normal IO and resync/recovery IO at | ||
57 | * the same time - resync/recovery can only happen when there | ||
58 | * is no other IO. So when either is active, the other has to wait. | ||
59 | * See more details description in raid1.c near raise_barrier(). | ||
60 | */ | ||
61 | wait_queue_head_t wait_barrier; | ||
41 | spinlock_t resync_lock; | 62 | spinlock_t resync_lock; |
42 | int nr_pending; | 63 | int nr_pending; |
43 | int nr_waiting; | 64 | int nr_waiting; |
44 | int nr_queued; | 65 | int nr_queued; |
45 | int barrier; | 66 | int barrier; |
46 | sector_t next_resync; | ||
47 | int fullsync; /* set to 1 if a full sync is needed, | ||
48 | * (fresh device added). | ||
49 | * Cleared when a sync completes. | ||
50 | */ | ||
51 | int recovery_disabled; /* when the same as | ||
52 | * mddev->recovery_disabled | ||
53 | * we don't allow recovery | ||
54 | * to be attempted as we | ||
55 | * expect a read error | ||
56 | */ | ||
57 | 67 | ||
58 | wait_queue_head_t wait_barrier; | 68 | /* Set to 1 if a full sync is needed, (fresh device added). |
69 | * Cleared when a sync completes. | ||
70 | */ | ||
71 | int fullsync; | ||
59 | 72 | ||
60 | struct pool_info *poolinfo; | 73 | /* When the same as mddev->recovery_disabled we don't allow |
74 | * recovery to be attempted as we expect a read error. | ||
75 | */ | ||
76 | int recovery_disabled; | ||
61 | 77 | ||
62 | struct page *tmppage; | ||
63 | 78 | ||
79 | /* poolinfo contains information about the content of the | ||
80 | * mempools - it changes when the array grows or shrinks | ||
81 | */ | ||
82 | struct pool_info *poolinfo; | ||
64 | mempool_t *r1bio_pool; | 83 | mempool_t *r1bio_pool; |
65 | mempool_t *r1buf_pool; | 84 | mempool_t *r1buf_pool; |
66 | 85 | ||
86 | /* temporary buffer to synchronous IO when attempting to repair | ||
87 | * a read error. | ||
88 | */ | ||
89 | struct page *tmppage; | ||
90 | |||
91 | |||
67 | /* When taking over an array from a different personality, we store | 92 | /* When taking over an array from a different personality, we store |
68 | * the new thread here until we fully activate the array. | 93 | * the new thread here until we fully activate the array. |
69 | */ | 94 | */ |