aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-09-23 04:06:41 -0400
committerNeilBrown <neilb@suse.de>2009-09-23 04:06:41 -0400
commita9f326ebf22a0de776815240fb76dabe139397ea (patch)
tree4402ba08931cd0663aca077be4d26e66c91869bd /drivers/md
parent7fa07729e439a6184bd824746d06a49cca553f15 (diff)
md: remove sparse waring "symbol xxx shadows an earlier one"
Rename some variable and remove some duplicate definitions to avoid there warnings. None of them are actual errors. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c10
-rw-r--r--drivers/md/raid0.c5
-rw-r--r--drivers/md/raid10.c2
-rw-r--r--drivers/md/raid5.c9
4 files changed, 14 insertions, 12 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 6aa497e4baf8..f64b33085255 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4575,10 +4575,10 @@ static int get_version(void __user * arg)
4575static int get_array_info(mddev_t * mddev, void __user * arg) 4575static int get_array_info(mddev_t * mddev, void __user * arg)
4576{ 4576{
4577 mdu_array_info_t info; 4577 mdu_array_info_t info;
4578 int nr,working,active,failed,spare; 4578 int nr,working,insync,failed,spare;
4579 mdk_rdev_t *rdev; 4579 mdk_rdev_t *rdev;
4580 4580
4581 nr=working=active=failed=spare=0; 4581 nr=working=insync=failed=spare=0;
4582 list_for_each_entry(rdev, &mddev->disks, same_set) { 4582 list_for_each_entry(rdev, &mddev->disks, same_set) {
4583 nr++; 4583 nr++;
4584 if (test_bit(Faulty, &rdev->flags)) 4584 if (test_bit(Faulty, &rdev->flags))
@@ -4586,7 +4586,7 @@ static int get_array_info(mddev_t * mddev, void __user * arg)
4586 else { 4586 else {
4587 working++; 4587 working++;
4588 if (test_bit(In_sync, &rdev->flags)) 4588 if (test_bit(In_sync, &rdev->flags))
4589 active++; 4589 insync++;
4590 else 4590 else
4591 spare++; 4591 spare++;
4592 } 4592 }
@@ -4611,7 +4611,7 @@ static int get_array_info(mddev_t * mddev, void __user * arg)
4611 info.state = (1<<MD_SB_CLEAN); 4611 info.state = (1<<MD_SB_CLEAN);
4612 if (mddev->bitmap && mddev->bitmap_offset) 4612 if (mddev->bitmap && mddev->bitmap_offset)
4613 info.state = (1<<MD_SB_BITMAP_PRESENT); 4613 info.state = (1<<MD_SB_BITMAP_PRESENT);
4614 info.active_disks = active; 4614 info.active_disks = insync;
4615 info.working_disks = working; 4615 info.working_disks = working;
4616 info.failed_disks = failed; 4616 info.failed_disks = failed;
4617 info.spare_disks = spare; 4617 info.spare_disks = spare;
@@ -4721,7 +4721,7 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
4721 if (!list_empty(&mddev->disks)) { 4721 if (!list_empty(&mddev->disks)) {
4722 mdk_rdev_t *rdev0 = list_entry(mddev->disks.next, 4722 mdk_rdev_t *rdev0 = list_entry(mddev->disks.next,
4723 mdk_rdev_t, same_set); 4723 mdk_rdev_t, same_set);
4724 int err = super_types[mddev->major_version] 4724 err = super_types[mddev->major_version]
4725 .load_super(rdev, rdev0, mddev->minor_version); 4725 .load_super(rdev, rdev0, mddev->minor_version);
4726 if (err < 0) { 4726 if (err < 0) {
4727 printk(KERN_WARNING 4727 printk(KERN_WARNING
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index f845ed98fec9..68a4d129206e 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -86,7 +86,7 @@ static void dump_zones(mddev_t *mddev)
86 86
87static int create_strip_zones(mddev_t *mddev) 87static int create_strip_zones(mddev_t *mddev)
88{ 88{
89 int i, c, j, err; 89 int i, c, err;
90 sector_t curr_zone_end, sectors; 90 sector_t curr_zone_end, sectors;
91 mdk_rdev_t *smallest, *rdev1, *rdev2, *rdev, **dev; 91 mdk_rdev_t *smallest, *rdev1, *rdev2, *rdev, **dev;
92 struct strip_zone *zone; 92 struct strip_zone *zone;
@@ -198,6 +198,8 @@ static int create_strip_zones(mddev_t *mddev)
198 /* now do the other zones */ 198 /* now do the other zones */
199 for (i = 1; i < conf->nr_strip_zones; i++) 199 for (i = 1; i < conf->nr_strip_zones; i++)
200 { 200 {
201 int j;
202
201 zone = conf->strip_zone + i; 203 zone = conf->strip_zone + i;
202 dev = conf->devlist + i * mddev->raid_disks; 204 dev = conf->devlist + i * mddev->raid_disks;
203 205
@@ -207,7 +209,6 @@ static int create_strip_zones(mddev_t *mddev)
207 c = 0; 209 c = 0;
208 210
209 for (j=0; j<cnt; j++) { 211 for (j=0; j<cnt; j++) {
210 char b[BDEVNAME_SIZE];
211 rdev = conf->devlist[j]; 212 rdev = conf->devlist[j];
212 printk(KERN_INFO "raid0: checking %s ...", 213 printk(KERN_INFO "raid0: checking %s ...",
213 bdevname(rdev->bdev, b)); 214 bdevname(rdev->bdev, b));
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index d0a2152e064f..8bca3835c9fd 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1773,7 +1773,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
1773 max_sync = RESYNC_PAGES << (PAGE_SHIFT-9); 1773 max_sync = RESYNC_PAGES << (PAGE_SHIFT-9);
1774 if (!test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { 1774 if (!test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
1775 /* recovery... the complicated one */ 1775 /* recovery... the complicated one */
1776 int i, j, k; 1776 int j, k;
1777 r10_bio = NULL; 1777 r10_bio = NULL;
1778 1778
1779 for (i=0 ; i<conf->raid_disks; i++) 1779 for (i=0 ; i<conf->raid_disks; i++)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 826eb3467357..763dcc40e513 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2756,7 +2756,8 @@ static bool handle_stripe5(struct stripe_head *sh)
2756 rcu_read_lock(); 2756 rcu_read_lock();
2757 for (i=disks; i--; ) { 2757 for (i=disks; i--; ) {
2758 mdk_rdev_t *rdev; 2758 mdk_rdev_t *rdev;
2759 struct r5dev *dev = &sh->dev[i]; 2759
2760 dev = &sh->dev[i];
2760 clear_bit(R5_Insync, &dev->flags); 2761 clear_bit(R5_Insync, &dev->flags);
2761 2762
2762 pr_debug("check %d: state 0x%lx toread %p read %p write %p " 2763 pr_debug("check %d: state 0x%lx toread %p read %p write %p "
@@ -3880,7 +3881,7 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped
3880 INIT_LIST_HEAD(&stripes); 3881 INIT_LIST_HEAD(&stripes);
3881 for (i = 0; i < reshape_sectors; i += STRIPE_SECTORS) { 3882 for (i = 0; i < reshape_sectors; i += STRIPE_SECTORS) {
3882 int j; 3883 int j;
3883 int skipped = 0; 3884 int skipped_disk = 0;
3884 sh = get_active_stripe(conf, stripe_addr+i, 0, 0, 1); 3885 sh = get_active_stripe(conf, stripe_addr+i, 0, 0, 1);
3885 set_bit(STRIPE_EXPANDING, &sh->state); 3886 set_bit(STRIPE_EXPANDING, &sh->state);
3886 atomic_inc(&conf->reshape_stripes); 3887 atomic_inc(&conf->reshape_stripes);
@@ -3896,14 +3897,14 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped
3896 continue; 3897 continue;
3897 s = compute_blocknr(sh, j, 0); 3898 s = compute_blocknr(sh, j, 0);
3898 if (s < raid5_size(mddev, 0, 0)) { 3899 if (s < raid5_size(mddev, 0, 0)) {
3899 skipped = 1; 3900 skipped_disk = 1;
3900 continue; 3901 continue;
3901 } 3902 }
3902 memset(page_address(sh->dev[j].page), 0, STRIPE_SIZE); 3903 memset(page_address(sh->dev[j].page), 0, STRIPE_SIZE);
3903 set_bit(R5_Expanded, &sh->dev[j].flags); 3904 set_bit(R5_Expanded, &sh->dev[j].flags);
3904 set_bit(R5_UPTODATE, &sh->dev[j].flags); 3905 set_bit(R5_UPTODATE, &sh->dev[j].flags);
3905 } 3906 }
3906 if (!skipped) { 3907 if (!skipped_disk) {
3907 set_bit(STRIPE_EXPAND_READY, &sh->state); 3908 set_bit(STRIPE_EXPAND_READY, &sh->state);
3908 set_bit(STRIPE_HANDLE, &sh->state); 3909 set_bit(STRIPE_HANDLE, &sh->state);
3909 } 3910 }