aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2012-07-30 20:03:52 -0400
committerNeilBrown <neilb@suse.de>2012-07-30 20:03:52 -0400
commitdc280d987f039ef35ac1e59c09b7154b61f385cf (patch)
tree470cf571b46bff86454106f1f549028c8415fcd8 /drivers/md
parent3bbae04b126fbd4c191b4167ea46ba9c4da46425 (diff)
MD RAID10: rename mirror_info structure
MD RAID10: Rename the structure 'mirror_info' to 'raid10_info' The same structure name ('mirror_info') is used by raid1. Each of these structures are defined in there respective header files. If dm-raid is to support both RAID1 and RAID10, the header files will be included and the structure names must not collide. Signed-off-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid10.c18
-rw-r--r--drivers/md/raid10.h6
2 files changed, 12 insertions, 12 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index b3d79db35e9b..f9c4baa7964d 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1546,7 +1546,7 @@ static void error(struct mddev *mddev, struct md_rdev *rdev)
1546static void print_conf(struct r10conf *conf) 1546static void print_conf(struct r10conf *conf)
1547{ 1547{
1548 int i; 1548 int i;
1549 struct mirror_info *tmp; 1549 struct raid10_info *tmp;
1550 1550
1551 printk(KERN_DEBUG "RAID10 conf printout:\n"); 1551 printk(KERN_DEBUG "RAID10 conf printout:\n");
1552 if (!conf) { 1552 if (!conf) {
@@ -1580,7 +1580,7 @@ static int raid10_spare_active(struct mddev *mddev)
1580{ 1580{
1581 int i; 1581 int i;
1582 struct r10conf *conf = mddev->private; 1582 struct r10conf *conf = mddev->private;
1583 struct mirror_info *tmp; 1583 struct raid10_info *tmp;
1584 int count = 0; 1584 int count = 0;
1585 unsigned long flags; 1585 unsigned long flags;
1586 1586
@@ -1655,7 +1655,7 @@ static int raid10_add_disk(struct mddev *mddev, struct md_rdev *rdev)
1655 else 1655 else
1656 mirror = first; 1656 mirror = first;
1657 for ( ; mirror <= last ; mirror++) { 1657 for ( ; mirror <= last ; mirror++) {
1658 struct mirror_info *p = &conf->mirrors[mirror]; 1658 struct raid10_info *p = &conf->mirrors[mirror];
1659 if (p->recovery_disabled == mddev->recovery_disabled) 1659 if (p->recovery_disabled == mddev->recovery_disabled)
1660 continue; 1660 continue;
1661 if (p->rdev) { 1661 if (p->rdev) {
@@ -1709,7 +1709,7 @@ static int raid10_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
1709 int err = 0; 1709 int err = 0;
1710 int number = rdev->raid_disk; 1710 int number = rdev->raid_disk;
1711 struct md_rdev **rdevp; 1711 struct md_rdev **rdevp;
1712 struct mirror_info *p = conf->mirrors + number; 1712 struct raid10_info *p = conf->mirrors + number;
1713 1713
1714 print_conf(conf); 1714 print_conf(conf);
1715 if (rdev == p->rdev) 1715 if (rdev == p->rdev)
@@ -2876,7 +2876,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr,
2876 sector_t sect; 2876 sector_t sect;
2877 int must_sync; 2877 int must_sync;
2878 int any_working; 2878 int any_working;
2879 struct mirror_info *mirror = &conf->mirrors[i]; 2879 struct raid10_info *mirror = &conf->mirrors[i];
2880 2880
2881 if ((mirror->rdev == NULL || 2881 if ((mirror->rdev == NULL ||
2882 test_bit(In_sync, &mirror->rdev->flags)) 2882 test_bit(In_sync, &mirror->rdev->flags))
@@ -3388,7 +3388,7 @@ static struct r10conf *setup_conf(struct mddev *mddev)
3388 goto out; 3388 goto out;
3389 3389
3390 /* FIXME calc properly */ 3390 /* FIXME calc properly */
3391 conf->mirrors = kzalloc(sizeof(struct mirror_info)*(mddev->raid_disks + 3391 conf->mirrors = kzalloc(sizeof(struct raid10_info)*(mddev->raid_disks +
3392 max(0,mddev->delta_disks)), 3392 max(0,mddev->delta_disks)),
3393 GFP_KERNEL); 3393 GFP_KERNEL);
3394 if (!conf->mirrors) 3394 if (!conf->mirrors)
@@ -3452,7 +3452,7 @@ static int run(struct mddev *mddev)
3452{ 3452{
3453 struct r10conf *conf; 3453 struct r10conf *conf;
3454 int i, disk_idx, chunk_size; 3454 int i, disk_idx, chunk_size;
3455 struct mirror_info *disk; 3455 struct raid10_info *disk;
3456 struct md_rdev *rdev; 3456 struct md_rdev *rdev;
3457 sector_t size; 3457 sector_t size;
3458 sector_t min_offset_diff = 0; 3458 sector_t min_offset_diff = 0;
@@ -3805,7 +3805,7 @@ static int raid10_check_reshape(struct mddev *mddev)
3805 if (mddev->delta_disks > 0) { 3805 if (mddev->delta_disks > 0) {
3806 /* allocate new 'mirrors' list */ 3806 /* allocate new 'mirrors' list */
3807 conf->mirrors_new = kzalloc( 3807 conf->mirrors_new = kzalloc(
3808 sizeof(struct mirror_info) 3808 sizeof(struct raid10_info)
3809 *(mddev->raid_disks + 3809 *(mddev->raid_disks +
3810 mddev->delta_disks), 3810 mddev->delta_disks),
3811 GFP_KERNEL); 3811 GFP_KERNEL);
@@ -3930,7 +3930,7 @@ static int raid10_start_reshape(struct mddev *mddev)
3930 spin_lock_irq(&conf->device_lock); 3930 spin_lock_irq(&conf->device_lock);
3931 if (conf->mirrors_new) { 3931 if (conf->mirrors_new) {
3932 memcpy(conf->mirrors_new, conf->mirrors, 3932 memcpy(conf->mirrors_new, conf->mirrors,
3933 sizeof(struct mirror_info)*conf->prev.raid_disks); 3933 sizeof(struct raid10_info)*conf->prev.raid_disks);
3934 smp_mb(); 3934 smp_mb();
3935 kfree(conf->mirrors_old); /* FIXME and elsewhere */ 3935 kfree(conf->mirrors_old); /* FIXME and elsewhere */
3936 conf->mirrors_old = conf->mirrors; 3936 conf->mirrors_old = conf->mirrors;
diff --git a/drivers/md/raid10.h b/drivers/md/raid10.h
index 135b1b0a1554..ecdb440b003a 100644
--- a/drivers/md/raid10.h
+++ b/drivers/md/raid10.h
@@ -1,7 +1,7 @@
1#ifndef _RAID10_H 1#ifndef _RAID10_H
2#define _RAID10_H 2#define _RAID10_H
3 3
4struct mirror_info { 4struct raid10_info {
5 struct md_rdev *rdev, *replacement; 5 struct md_rdev *rdev, *replacement;
6 sector_t head_position; 6 sector_t head_position;
7 int recovery_disabled; /* matches 7 int recovery_disabled; /* matches
@@ -13,8 +13,8 @@ struct mirror_info {
13 13
14struct r10conf { 14struct r10conf {
15 struct mddev *mddev; 15 struct mddev *mddev;
16 struct mirror_info *mirrors; 16 struct raid10_info *mirrors;
17 struct mirror_info *mirrors_new, *mirrors_old; 17 struct raid10_info *mirrors_new, *mirrors_old;
18 spinlock_t device_lock; 18 spinlock_t device_lock;
19 19
20 /* geometry */ 20 /* geometry */