diff options
author | NeilBrown <neilb@suse.de> | 2012-05-20 19:28:20 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-05-20 19:28:20 -0400 |
commit | 5cf00fcd3c98d2eafb58ac7a649bbdb9dbc4902b (patch) | |
tree | 0a96aa84d276e5e627603c7ad4740e1d607ebbad /drivers/md/raid10.h | |
parent | b5254dd5fdd9abcacadb5101beb35df9ae8cc564 (diff) |
md/raid10: collect some geometry fields into a dedicated structure.
We will shortly be adding reshape support for RAID10 which will
require it having 2 concurrent geometries (before and after).
To make that easier, collect most geometry fields into 'struct geom'
and access them from there. Then we will more easily be able to add
a second set of fields.
Note that 'copies' is not in this struct and so cannot be changed.
There is little need to change this number and doing so is a lot
more difficult as it requires reallocating more things.
So leave it out for now.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.h')
-rw-r--r-- | drivers/md/raid10.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/md/raid10.h b/drivers/md/raid10.h index 7c615613c381..4c4942ac46fc 100644 --- a/drivers/md/raid10.h +++ b/drivers/md/raid10.h | |||
@@ -14,33 +14,34 @@ struct mirror_info { | |||
14 | struct r10conf { | 14 | struct r10conf { |
15 | struct mddev *mddev; | 15 | struct mddev *mddev; |
16 | struct mirror_info *mirrors; | 16 | struct mirror_info *mirrors; |
17 | int raid_disks; | ||
18 | spinlock_t device_lock; | 17 | spinlock_t device_lock; |
19 | 18 | ||
20 | /* geometry */ | 19 | /* geometry */ |
21 | int near_copies; /* number of copies laid out | 20 | struct geom { |
21 | int raid_disks; | ||
22 | int near_copies; /* number of copies laid out | ||
22 | * raid0 style */ | 23 | * raid0 style */ |
23 | int far_copies; /* number of copies laid out | 24 | int far_copies; /* number of copies laid out |
24 | * at large strides across drives | 25 | * at large strides across drives |
25 | */ | 26 | */ |
26 | int far_offset; /* far_copies are offset by 1 | 27 | int far_offset; /* far_copies are offset by 1 |
27 | * stripe instead of many | 28 | * stripe instead of many |
28 | */ | 29 | */ |
29 | int copies; /* near_copies * far_copies. | 30 | sector_t stride; /* distance between far copies. |
30 | * must be <= raid_disks | ||
31 | */ | ||
32 | sector_t stride; /* distance between far copies. | ||
33 | * This is size / far_copies unless | 31 | * This is size / far_copies unless |
34 | * far_offset, in which case it is | 32 | * far_offset, in which case it is |
35 | * 1 stripe. | 33 | * 1 stripe. |
36 | */ | 34 | */ |
35 | int chunk_shift; /* shift from chunks to sectors */ | ||
36 | sector_t chunk_mask; | ||
37 | } geo; | ||
38 | int copies; /* near_copies * far_copies. | ||
39 | * must be <= raid_disks | ||
40 | */ | ||
37 | 41 | ||
38 | sector_t dev_sectors; /* temp copy of | 42 | sector_t dev_sectors; /* temp copy of |
39 | * mddev->dev_sectors */ | 43 | * mddev->dev_sectors */ |
40 | 44 | ||
41 | int chunk_shift; /* shift from chunks to sectors */ | ||
42 | sector_t chunk_mask; | ||
43 | |||
44 | struct list_head retry_list; | 45 | struct list_head retry_list; |
45 | /* queue pending writes and submit them on unplug */ | 46 | /* queue pending writes and submit them on unplug */ |
46 | struct bio_list pending_bio_list; | 47 | struct bio_list pending_bio_list; |