Commit 0eaf822c authored by Jonathan Brassow's avatar Jonathan Brassow Committed by NeilBrown

MD RAID1: rename mirror_info structure

MD RAID1: Rename the structure 'mirror_info' to 'raid1_info'

The same structure name ('mirror_info') is used by raid10.  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.  While only one of these structure
names needs to change, this patch adds consistency to the naming of the
structure.
Signed-off-by: default avatarJonathan Brassow <jbrassow@redhat.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent dc280d98
...@@ -873,7 +873,7 @@ static void alloc_behind_pages(struct bio *bio, struct r1bio *r1_bio) ...@@ -873,7 +873,7 @@ static void alloc_behind_pages(struct bio *bio, struct r1bio *r1_bio)
static void make_request(struct mddev *mddev, struct bio * bio) static void make_request(struct mddev *mddev, struct bio * bio)
{ {
struct r1conf *conf = mddev->private; struct r1conf *conf = mddev->private;
struct mirror_info *mirror; struct raid1_info *mirror;
struct r1bio *r1_bio; struct r1bio *r1_bio;
struct bio *read_bio; struct bio *read_bio;
int i, disks; int i, disks;
...@@ -1364,7 +1364,7 @@ static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev) ...@@ -1364,7 +1364,7 @@ static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev)
struct r1conf *conf = mddev->private; struct r1conf *conf = mddev->private;
int err = -EEXIST; int err = -EEXIST;
int mirror = 0; int mirror = 0;
struct mirror_info *p; struct raid1_info *p;
int first = 0; int first = 0;
int last = conf->raid_disks - 1; int last = conf->raid_disks - 1;
struct request_queue *q = bdev_get_queue(rdev->bdev); struct request_queue *q = bdev_get_queue(rdev->bdev);
...@@ -1433,7 +1433,7 @@ static int raid1_remove_disk(struct mddev *mddev, struct md_rdev *rdev) ...@@ -1433,7 +1433,7 @@ static int raid1_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
struct r1conf *conf = mddev->private; struct r1conf *conf = mddev->private;
int err = 0; int err = 0;
int number = rdev->raid_disk; int number = rdev->raid_disk;
struct mirror_info *p = conf->mirrors+ number; struct raid1_info *p = conf->mirrors + number;
if (rdev != p->rdev) if (rdev != p->rdev)
p = conf->mirrors + conf->raid_disks + number; p = conf->mirrors + conf->raid_disks + number;
...@@ -2521,7 +2521,7 @@ static struct r1conf *setup_conf(struct mddev *mddev) ...@@ -2521,7 +2521,7 @@ static struct r1conf *setup_conf(struct mddev *mddev)
{ {
struct r1conf *conf; struct r1conf *conf;
int i; int i;
struct mirror_info *disk; struct raid1_info *disk;
struct md_rdev *rdev; struct md_rdev *rdev;
int err = -ENOMEM; int err = -ENOMEM;
...@@ -2529,7 +2529,7 @@ static struct r1conf *setup_conf(struct mddev *mddev) ...@@ -2529,7 +2529,7 @@ static struct r1conf *setup_conf(struct mddev *mddev)
if (!conf) if (!conf)
goto abort; goto abort;
conf->mirrors = kzalloc(sizeof(struct mirror_info) conf->mirrors = kzalloc(sizeof(struct raid1_info)
* mddev->raid_disks * 2, * mddev->raid_disks * 2,
GFP_KERNEL); GFP_KERNEL);
if (!conf->mirrors) if (!conf->mirrors)
...@@ -2798,7 +2798,7 @@ static int raid1_reshape(struct mddev *mddev) ...@@ -2798,7 +2798,7 @@ static int raid1_reshape(struct mddev *mddev)
*/ */
mempool_t *newpool, *oldpool; mempool_t *newpool, *oldpool;
struct pool_info *newpoolinfo; struct pool_info *newpoolinfo;
struct mirror_info *newmirrors; struct raid1_info *newmirrors;
struct r1conf *conf = mddev->private; struct r1conf *conf = mddev->private;
int cnt, raid_disks; int cnt, raid_disks;
unsigned long flags; unsigned long flags;
...@@ -2841,7 +2841,7 @@ static int raid1_reshape(struct mddev *mddev) ...@@ -2841,7 +2841,7 @@ static int raid1_reshape(struct mddev *mddev)
kfree(newpoolinfo); kfree(newpoolinfo);
return -ENOMEM; return -ENOMEM;
} }
newmirrors = kzalloc(sizeof(struct mirror_info) * raid_disks * 2, newmirrors = kzalloc(sizeof(struct raid1_info) * raid_disks * 2,
GFP_KERNEL); GFP_KERNEL);
if (!newmirrors) { if (!newmirrors) {
kfree(newpoolinfo); kfree(newpoolinfo);
......
#ifndef _RAID1_H #ifndef _RAID1_H
#define _RAID1_H #define _RAID1_H
struct mirror_info { struct raid1_info {
struct md_rdev *rdev; struct md_rdev *rdev;
sector_t head_position; sector_t head_position;
}; };
...@@ -24,7 +24,7 @@ struct pool_info { ...@@ -24,7 +24,7 @@ struct pool_info {
struct r1conf { struct r1conf {
struct mddev *mddev; struct mddev *mddev;
struct mirror_info *mirrors; /* twice 'raid_disks' to struct raid1_info *mirrors; /* twice 'raid_disks' to
* allow for replacements. * allow for replacements.
*/ */
int raid_disks; int raid_disks;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment