Commit 76186dd8b73d2b7b9b4c8629b89c845e97009801

Authored by NeilBrown
Committed by Linus Torvalds
1 parent 02c2de8cc8

[PATCH] md: remove 'working_disks' from raid10 state

It isn't needed as mddev->degraded contains equivalent info.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 2 changed files with 4 additions and 9 deletions Side-by-side Diff

... ... @@ -921,7 +921,7 @@
921 921 seq_printf(seq, " %d far-copies", conf->far_copies);
922 922 }
923 923 seq_printf(seq, " [%d/%d] [", conf->raid_disks,
924   - conf->working_disks);
  924 + conf->raid_disks - mddev->degraded);
925 925 for (i = 0; i < conf->raid_disks; i++)
926 926 seq_printf(seq, "%s",
927 927 conf->mirrors[i].rdev &&
... ... @@ -941,7 +941,7 @@
941 941 * else mark the drive as failed
942 942 */
943 943 if (test_bit(In_sync, &rdev->flags)
944   - && conf->working_disks == 1)
  944 + && conf->raid_disks-mddev->degraded == 1)
945 945 /*
946 946 * Don't fail the drive, just return an IO error.
947 947 * The test should really be more sophisticated than
... ... @@ -952,7 +952,6 @@
952 952 return;
953 953 if (test_bit(In_sync, &rdev->flags)) {
954 954 mddev->degraded++;
955   - conf->working_disks--;
956 955 /*
957 956 * if recovery is running, make sure it aborts.
958 957 */
... ... @@ -963,7 +962,7 @@
963 962 set_bit(MD_CHANGE_DEVS, &mddev->flags);
964 963 printk(KERN_ALERT "raid10: Disk failure on %s, disabling device. \n"
965 964 " Operation continuing on %d devices\n",
966   - bdevname(rdev->bdev,b), conf->working_disks);
  965 + bdevname(rdev->bdev,b), conf->raid_disks - mddev->degraded);
967 966 }
968 967  
969 968 static void print_conf(conf_t *conf)
... ... @@ -976,7 +975,7 @@
976 975 printk("(!conf)\n");
977 976 return;
978 977 }
979   - printk(" --- wd:%d rd:%d\n", conf->working_disks,
  978 + printk(" --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded,
980 979 conf->raid_disks);
981 980  
982 981 for (i = 0; i < conf->raid_disks; i++) {
... ... @@ -1035,7 +1034,6 @@
1035 1034 if (tmp->rdev
1036 1035 && !test_bit(Faulty, &tmp->rdev->flags)
1037 1036 && !test_bit(In_sync, &tmp->rdev->flags)) {
1038   - conf->working_disks++;
1039 1037 mddev->degraded--;
1040 1038 set_bit(In_sync, &tmp->rdev->flags);
1041 1039 }
... ... @@ -2035,8 +2033,6 @@
2035 2033 mddev->queue->max_sectors = (PAGE_SIZE>>9);
2036 2034  
2037 2035 disk->head_position = 0;
2038   - if (!test_bit(Faulty, &rdev->flags) && test_bit(In_sync, &rdev->flags))
2039   - conf->working_disks++;
2040 2036 }
2041 2037 conf->raid_disks = mddev->raid_disks;
2042 2038 conf->mddev = mddev;
include/linux/raid/raid10.h
... ... @@ -16,7 +16,6 @@
16 16 mddev_t *mddev;
17 17 mirror_info_t *mirrors;
18 18 int raid_disks;
19   - int working_disks;
20 19 spinlock_t device_lock;
21 20  
22 21 /* geometry */