aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-10-11 01:48:59 -0400
committerNeilBrown <neilb@suse.de>2011-10-11 01:48:59 -0400
commite373ab109172abc2d821bd3b5c1b400acddef5a5 (patch)
tree48ca1b8ded6ec90a47015ab7316fe8cadb9f8d05
parent69724e28ca99990a8f0b5370bb946d7704936d67 (diff)
md/raid0: typedef removal: raid0_conf_t -> struct r0conf
Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--drivers/md/raid0.c22
-rw-r--r--drivers/md/raid0.h8
-rw-r--r--drivers/md/raid10.c6
-rw-r--r--drivers/md/raid5.c8
4 files changed, 20 insertions, 24 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index db51e6f68191..38a9012ff4fe 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -28,7 +28,7 @@
28static int raid0_congested(void *data, int bits) 28static int raid0_congested(void *data, int bits)
29{ 29{
30 struct mddev *mddev = data; 30 struct mddev *mddev = data;
31 raid0_conf_t *conf = mddev->private; 31 struct r0conf *conf = mddev->private;
32 struct md_rdev **devlist = conf->devlist; 32 struct md_rdev **devlist = conf->devlist;
33 int raid_disks = conf->strip_zone[0].nb_dev; 33 int raid_disks = conf->strip_zone[0].nb_dev;
34 int i, ret = 0; 34 int i, ret = 0;
@@ -53,7 +53,7 @@ static void dump_zones(struct mddev *mddev)
53 sector_t zone_size = 0; 53 sector_t zone_size = 0;
54 sector_t zone_start = 0; 54 sector_t zone_start = 0;
55 char b[BDEVNAME_SIZE]; 55 char b[BDEVNAME_SIZE];
56 raid0_conf_t *conf = mddev->private; 56 struct r0conf *conf = mddev->private;
57 int raid_disks = conf->strip_zone[0].nb_dev; 57 int raid_disks = conf->strip_zone[0].nb_dev;
58 printk(KERN_INFO "md: RAID0 configuration for %s - %d zone%s\n", 58 printk(KERN_INFO "md: RAID0 configuration for %s - %d zone%s\n",
59 mdname(mddev), 59 mdname(mddev),
@@ -77,7 +77,7 @@ static void dump_zones(struct mddev *mddev)
77 printk(KERN_INFO "\n"); 77 printk(KERN_INFO "\n");
78} 78}
79 79
80static int create_strip_zones(struct mddev *mddev, raid0_conf_t **private_conf) 80static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
81{ 81{
82 int i, c, err; 82 int i, c, err;
83 sector_t curr_zone_end, sectors; 83 sector_t curr_zone_end, sectors;
@@ -86,7 +86,7 @@ static int create_strip_zones(struct mddev *mddev, raid0_conf_t **private_conf)
86 int cnt; 86 int cnt;
87 char b[BDEVNAME_SIZE]; 87 char b[BDEVNAME_SIZE];
88 char b2[BDEVNAME_SIZE]; 88 char b2[BDEVNAME_SIZE];
89 raid0_conf_t *conf = kzalloc(sizeof(*conf), GFP_KERNEL); 89 struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
90 90
91 if (!conf) 91 if (!conf)
92 return -ENOMEM; 92 return -ENOMEM;
@@ -336,7 +336,7 @@ static sector_t raid0_size(struct mddev *mddev, sector_t sectors, int raid_disks
336 336
337static int raid0_run(struct mddev *mddev) 337static int raid0_run(struct mddev *mddev)
338{ 338{
339 raid0_conf_t *conf; 339 struct r0conf *conf;
340 int ret; 340 int ret;
341 341
342 if (mddev->chunk_sectors == 0) { 342 if (mddev->chunk_sectors == 0) {
@@ -386,7 +386,7 @@ static int raid0_run(struct mddev *mddev)
386 386
387static int raid0_stop(struct mddev *mddev) 387static int raid0_stop(struct mddev *mddev)
388{ 388{
389 raid0_conf_t *conf = mddev->private; 389 struct r0conf *conf = mddev->private;
390 390
391 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ 391 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
392 kfree(conf->strip_zone); 392 kfree(conf->strip_zone);
@@ -399,7 +399,7 @@ static int raid0_stop(struct mddev *mddev)
399/* Find the zone which holds a particular offset 399/* Find the zone which holds a particular offset
400 * Update *sectorp to be an offset in that zone 400 * Update *sectorp to be an offset in that zone
401 */ 401 */
402static struct strip_zone *find_zone(struct raid0_private_data *conf, 402static struct strip_zone *find_zone(struct r0conf *conf,
403 sector_t *sectorp) 403 sector_t *sectorp)
404{ 404{
405 int i; 405 int i;
@@ -424,7 +424,7 @@ static struct md_rdev *map_sector(struct mddev *mddev, struct strip_zone *zone,
424{ 424{
425 unsigned int sect_in_chunk; 425 unsigned int sect_in_chunk;
426 sector_t chunk; 426 sector_t chunk;
427 raid0_conf_t *conf = mddev->private; 427 struct r0conf *conf = mddev->private;
428 int raid_disks = conf->strip_zone[0].nb_dev; 428 int raid_disks = conf->strip_zone[0].nb_dev;
429 unsigned int chunk_sects = mddev->chunk_sectors; 429 unsigned int chunk_sects = mddev->chunk_sectors;
430 430
@@ -537,7 +537,7 @@ static void raid0_status(struct seq_file *seq, struct mddev *mddev)
537static void *raid0_takeover_raid45(struct mddev *mddev) 537static void *raid0_takeover_raid45(struct mddev *mddev)
538{ 538{
539 struct md_rdev *rdev; 539 struct md_rdev *rdev;
540 raid0_conf_t *priv_conf; 540 struct r0conf *priv_conf;
541 541
542 if (mddev->degraded != 1) { 542 if (mddev->degraded != 1) {
543 printk(KERN_ERR "md/raid0:%s: raid5 must be degraded! Degraded disks: %d\n", 543 printk(KERN_ERR "md/raid0:%s: raid5 must be degraded! Degraded disks: %d\n",
@@ -570,7 +570,7 @@ static void *raid0_takeover_raid45(struct mddev *mddev)
570 570
571static void *raid0_takeover_raid10(struct mddev *mddev) 571static void *raid0_takeover_raid10(struct mddev *mddev)
572{ 572{
573 raid0_conf_t *priv_conf; 573 struct r0conf *priv_conf;
574 574
575 /* Check layout: 575 /* Check layout:
576 * - far_copies must be 1 576 * - far_copies must be 1
@@ -611,7 +611,7 @@ static void *raid0_takeover_raid10(struct mddev *mddev)
611 611
612static void *raid0_takeover_raid1(struct mddev *mddev) 612static void *raid0_takeover_raid1(struct mddev *mddev)
613{ 613{
614 raid0_conf_t *priv_conf; 614 struct r0conf *priv_conf;
615 615
616 /* Check layout: 616 /* Check layout:
617 * - (N - 1) mirror drives must be already faulty 617 * - (N - 1) mirror drives must be already faulty
diff --git a/drivers/md/raid0.h b/drivers/md/raid0.h
index 9d877b8d382c..0884bba8df4c 100644
--- a/drivers/md/raid0.h
+++ b/drivers/md/raid0.h
@@ -1,20 +1,16 @@
1#ifndef _RAID0_H 1#ifndef _RAID0_H
2#define _RAID0_H 2#define _RAID0_H
3 3
4struct strip_zone 4struct strip_zone {
5{
6 sector_t zone_end; /* Start of the next zone (in sectors) */ 5 sector_t zone_end; /* Start of the next zone (in sectors) */
7 sector_t dev_start; /* Zone offset in real dev (in sectors) */ 6 sector_t dev_start; /* Zone offset in real dev (in sectors) */
8 int nb_dev; /* # of devices attached to the zone */ 7 int nb_dev; /* # of devices attached to the zone */
9}; 8};
10 9
11struct raid0_private_data 10struct r0conf {
12{
13 struct strip_zone *strip_zone; 11 struct strip_zone *strip_zone;
14 struct md_rdev **devlist; /* lists of rdevs, pointed to by strip_zone->dev */ 12 struct md_rdev **devlist; /* lists of rdevs, pointed to by strip_zone->dev */
15 int nr_strip_zones; 13 int nr_strip_zones;
16}; 14};
17 15
18typedef struct raid0_private_data raid0_conf_t;
19
20#endif 16#endif
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index d5fb4c8da772..39661b19f409 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3031,15 +3031,15 @@ static void *raid10_takeover_raid0(struct mddev *mddev)
3031 3031
3032static void *raid10_takeover(struct mddev *mddev) 3032static void *raid10_takeover(struct mddev *mddev)
3033{ 3033{
3034 struct raid0_private_data *raid0_priv; 3034 struct r0conf *raid0_conf;
3035 3035
3036 /* raid10 can take over: 3036 /* raid10 can take over:
3037 * raid0 - providing it has only two drives 3037 * raid0 - providing it has only two drives
3038 */ 3038 */
3039 if (mddev->level == 0) { 3039 if (mddev->level == 0) {
3040 /* for raid0 takeover only one zone is supported */ 3040 /* for raid0 takeover only one zone is supported */
3041 raid0_priv = mddev->private; 3041 raid0_conf = mddev->private;
3042 if (raid0_priv->nr_strip_zones > 1) { 3042 if (raid0_conf->nr_strip_zones > 1) {
3043 printk(KERN_ERR "md/raid10:%s: cannot takeover raid 0" 3043 printk(KERN_ERR "md/raid10:%s: cannot takeover raid 0"
3044 " with more than one zone.\n", 3044 " with more than one zone.\n",
3045 mdname(mddev)); 3045 mdname(mddev));
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 17725c59eb0b..8514e9aeb369 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5405,18 +5405,18 @@ static void raid5_quiesce(struct mddev *mddev, int state)
5405 5405
5406static void *raid45_takeover_raid0(struct mddev *mddev, int level) 5406static void *raid45_takeover_raid0(struct mddev *mddev, int level)
5407{ 5407{
5408 struct raid0_private_data *raid0_priv = mddev->private; 5408 struct r0conf *raid0_conf = mddev->private;
5409 sector_t sectors; 5409 sector_t sectors;
5410 5410
5411 /* for raid0 takeover only one zone is supported */ 5411 /* for raid0 takeover only one zone is supported */
5412 if (raid0_priv->nr_strip_zones > 1) { 5412 if (raid0_conf->nr_strip_zones > 1) {
5413 printk(KERN_ERR "md/raid:%s: cannot takeover raid0 with more than one zone.\n", 5413 printk(KERN_ERR "md/raid:%s: cannot takeover raid0 with more than one zone.\n",
5414 mdname(mddev)); 5414 mdname(mddev));
5415 return ERR_PTR(-EINVAL); 5415 return ERR_PTR(-EINVAL);
5416 } 5416 }
5417 5417
5418 sectors = raid0_priv->strip_zone[0].zone_end; 5418 sectors = raid0_conf->strip_zone[0].zone_end;
5419 sector_div(sectors, raid0_priv->strip_zone[0].nb_dev); 5419 sector_div(sectors, raid0_conf->strip_zone[0].nb_dev);
5420 mddev->dev_sectors = sectors; 5420 mddev->dev_sectors = sectors;
5421 mddev->new_level = level; 5421 mddev->new_level = level;
5422 mddev->new_layout = ALGORITHM_PARITY_N; 5422 mddev->new_layout = ALGORITHM_PARITY_N;