diff options
author | NeilBrown <neilb@suse.de> | 2011-10-11 01:45:26 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-10-11 01:45:26 -0400 |
commit | 3cb03002000f133f9f97269edefd73611eafc873 (patch) | |
tree | 77fdb146666298b33aaeef0c05f082b6f82840fe /drivers/md/raid1.c | |
parent | 50de8df4abca1b27dbf7b2f81a56451bd8b5a7d8 (diff) |
md: removing typedefs: mdk_rdev_t -> struct md_rdev
The typedefs are just annoying. 'mdk' probably refers to 'md_k.h'
which used to be an include file that defined this thing.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index c8993fb8286c..de7d2b677066 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -475,7 +475,7 @@ static int read_balance(conf_t *conf, r1bio_t *r1_bio, int *max_sectors) | |||
475 | int best_disk; | 475 | int best_disk; |
476 | int i; | 476 | int i; |
477 | sector_t best_dist; | 477 | sector_t best_dist; |
478 | mdk_rdev_t *rdev; | 478 | struct md_rdev *rdev; |
479 | int choose_first; | 479 | int choose_first; |
480 | 480 | ||
481 | rcu_read_lock(); | 481 | rcu_read_lock(); |
@@ -600,7 +600,7 @@ int md_raid1_congested(mddev_t *mddev, int bits) | |||
600 | 600 | ||
601 | rcu_read_lock(); | 601 | rcu_read_lock(); |
602 | for (i = 0; i < mddev->raid_disks; i++) { | 602 | for (i = 0; i < mddev->raid_disks; i++) { |
603 | mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev); | 603 | struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev); |
604 | if (rdev && !test_bit(Faulty, &rdev->flags)) { | 604 | if (rdev && !test_bit(Faulty, &rdev->flags)) { |
605 | struct request_queue *q = bdev_get_queue(rdev->bdev); | 605 | struct request_queue *q = bdev_get_queue(rdev->bdev); |
606 | 606 | ||
@@ -808,7 +808,7 @@ static int make_request(mddev_t *mddev, struct bio * bio) | |||
808 | const int rw = bio_data_dir(bio); | 808 | const int rw = bio_data_dir(bio); |
809 | const unsigned long do_sync = (bio->bi_rw & REQ_SYNC); | 809 | const unsigned long do_sync = (bio->bi_rw & REQ_SYNC); |
810 | const unsigned long do_flush_fua = (bio->bi_rw & (REQ_FLUSH | REQ_FUA)); | 810 | const unsigned long do_flush_fua = (bio->bi_rw & (REQ_FLUSH | REQ_FUA)); |
811 | mdk_rdev_t *blocked_rdev; | 811 | struct md_rdev *blocked_rdev; |
812 | int plugged; | 812 | int plugged; |
813 | int first_clone; | 813 | int first_clone; |
814 | int sectors_handled; | 814 | int sectors_handled; |
@@ -963,7 +963,7 @@ read_again: | |||
963 | rcu_read_lock(); | 963 | rcu_read_lock(); |
964 | max_sectors = r1_bio->sectors; | 964 | max_sectors = r1_bio->sectors; |
965 | for (i = 0; i < disks; i++) { | 965 | for (i = 0; i < disks; i++) { |
966 | mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev); | 966 | struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev); |
967 | if (rdev && unlikely(test_bit(Blocked, &rdev->flags))) { | 967 | if (rdev && unlikely(test_bit(Blocked, &rdev->flags))) { |
968 | atomic_inc(&rdev->nr_pending); | 968 | atomic_inc(&rdev->nr_pending); |
969 | blocked_rdev = rdev; | 969 | blocked_rdev = rdev; |
@@ -1147,7 +1147,7 @@ static void status(struct seq_file *seq, mddev_t *mddev) | |||
1147 | conf->raid_disks - mddev->degraded); | 1147 | conf->raid_disks - mddev->degraded); |
1148 | rcu_read_lock(); | 1148 | rcu_read_lock(); |
1149 | for (i = 0; i < conf->raid_disks; i++) { | 1149 | for (i = 0; i < conf->raid_disks; i++) { |
1150 | mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev); | 1150 | struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev); |
1151 | seq_printf(seq, "%s", | 1151 | seq_printf(seq, "%s", |
1152 | rdev && test_bit(In_sync, &rdev->flags) ? "U" : "_"); | 1152 | rdev && test_bit(In_sync, &rdev->flags) ? "U" : "_"); |
1153 | } | 1153 | } |
@@ -1156,7 +1156,7 @@ static void status(struct seq_file *seq, mddev_t *mddev) | |||
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | 1158 | ||
1159 | static void error(mddev_t *mddev, mdk_rdev_t *rdev) | 1159 | static void error(mddev_t *mddev, struct md_rdev *rdev) |
1160 | { | 1160 | { |
1161 | char b[BDEVNAME_SIZE]; | 1161 | char b[BDEVNAME_SIZE]; |
1162 | conf_t *conf = mddev->private; | 1162 | conf_t *conf = mddev->private; |
@@ -1214,7 +1214,7 @@ static void print_conf(conf_t *conf) | |||
1214 | rcu_read_lock(); | 1214 | rcu_read_lock(); |
1215 | for (i = 0; i < conf->raid_disks; i++) { | 1215 | for (i = 0; i < conf->raid_disks; i++) { |
1216 | char b[BDEVNAME_SIZE]; | 1216 | char b[BDEVNAME_SIZE]; |
1217 | mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev); | 1217 | struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev); |
1218 | if (rdev) | 1218 | if (rdev) |
1219 | printk(KERN_DEBUG " disk %d, wo:%d, o:%d, dev:%s\n", | 1219 | printk(KERN_DEBUG " disk %d, wo:%d, o:%d, dev:%s\n", |
1220 | i, !test_bit(In_sync, &rdev->flags), | 1220 | i, !test_bit(In_sync, &rdev->flags), |
@@ -1246,7 +1246,7 @@ static int raid1_spare_active(mddev_t *mddev) | |||
1246 | * Called under mddev lock, so rcu protection not needed. | 1246 | * Called under mddev lock, so rcu protection not needed. |
1247 | */ | 1247 | */ |
1248 | for (i = 0; i < conf->raid_disks; i++) { | 1248 | for (i = 0; i < conf->raid_disks; i++) { |
1249 | mdk_rdev_t *rdev = conf->mirrors[i].rdev; | 1249 | struct md_rdev *rdev = conf->mirrors[i].rdev; |
1250 | if (rdev | 1250 | if (rdev |
1251 | && !test_bit(Faulty, &rdev->flags) | 1251 | && !test_bit(Faulty, &rdev->flags) |
1252 | && !test_and_set_bit(In_sync, &rdev->flags)) { | 1252 | && !test_and_set_bit(In_sync, &rdev->flags)) { |
@@ -1263,7 +1263,7 @@ static int raid1_spare_active(mddev_t *mddev) | |||
1263 | } | 1263 | } |
1264 | 1264 | ||
1265 | 1265 | ||
1266 | static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) | 1266 | static int raid1_add_disk(mddev_t *mddev, struct md_rdev *rdev) |
1267 | { | 1267 | { |
1268 | conf_t *conf = mddev->private; | 1268 | conf_t *conf = mddev->private; |
1269 | int err = -EEXIST; | 1269 | int err = -EEXIST; |
@@ -1315,7 +1315,7 @@ static int raid1_remove_disk(mddev_t *mddev, int number) | |||
1315 | { | 1315 | { |
1316 | conf_t *conf = mddev->private; | 1316 | conf_t *conf = mddev->private; |
1317 | int err = 0; | 1317 | int err = 0; |
1318 | mdk_rdev_t *rdev; | 1318 | struct md_rdev *rdev; |
1319 | mirror_info_t *p = conf->mirrors+ number; | 1319 | mirror_info_t *p = conf->mirrors+ number; |
1320 | 1320 | ||
1321 | print_conf(conf); | 1321 | print_conf(conf); |
@@ -1419,7 +1419,7 @@ static void end_sync_write(struct bio *bio, int error) | |||
1419 | } | 1419 | } |
1420 | } | 1420 | } |
1421 | 1421 | ||
1422 | static int r1_sync_page_io(mdk_rdev_t *rdev, sector_t sector, | 1422 | static int r1_sync_page_io(struct md_rdev *rdev, sector_t sector, |
1423 | int sectors, struct page *page, int rw) | 1423 | int sectors, struct page *page, int rw) |
1424 | { | 1424 | { |
1425 | if (sync_page_io(rdev, sector, sectors << 9, page, rw, false)) | 1425 | if (sync_page_io(rdev, sector, sectors << 9, page, rw, false)) |
@@ -1457,7 +1457,7 @@ static int fix_sync_read_error(r1bio_t *r1_bio) | |||
1457 | int s = sectors; | 1457 | int s = sectors; |
1458 | int d = r1_bio->read_disk; | 1458 | int d = r1_bio->read_disk; |
1459 | int success = 0; | 1459 | int success = 0; |
1460 | mdk_rdev_t *rdev; | 1460 | struct md_rdev *rdev; |
1461 | int start; | 1461 | int start; |
1462 | 1462 | ||
1463 | if (s > (PAGE_SIZE>>9)) | 1463 | if (s > (PAGE_SIZE>>9)) |
@@ -1696,7 +1696,7 @@ static void fix_read_error(conf_t *conf, int read_disk, | |||
1696 | int d = read_disk; | 1696 | int d = read_disk; |
1697 | int success = 0; | 1697 | int success = 0; |
1698 | int start; | 1698 | int start; |
1699 | mdk_rdev_t *rdev; | 1699 | struct md_rdev *rdev; |
1700 | 1700 | ||
1701 | if (s > (PAGE_SIZE>>9)) | 1701 | if (s > (PAGE_SIZE>>9)) |
1702 | s = PAGE_SIZE >> 9; | 1702 | s = PAGE_SIZE >> 9; |
@@ -1727,7 +1727,7 @@ static void fix_read_error(conf_t *conf, int read_disk, | |||
1727 | 1727 | ||
1728 | if (!success) { | 1728 | if (!success) { |
1729 | /* Cannot read from anywhere - mark it bad */ | 1729 | /* Cannot read from anywhere - mark it bad */ |
1730 | mdk_rdev_t *rdev = conf->mirrors[read_disk].rdev; | 1730 | struct md_rdev *rdev = conf->mirrors[read_disk].rdev; |
1731 | if (!rdev_set_badblocks(rdev, sect, s, 0)) | 1731 | if (!rdev_set_badblocks(rdev, sect, s, 0)) |
1732 | md_error(mddev, rdev); | 1732 | md_error(mddev, rdev); |
1733 | break; | 1733 | break; |
@@ -1794,7 +1794,7 @@ static int narrow_write_error(r1bio_t *r1_bio, int i) | |||
1794 | { | 1794 | { |
1795 | mddev_t *mddev = r1_bio->mddev; | 1795 | mddev_t *mddev = r1_bio->mddev; |
1796 | conf_t *conf = mddev->private; | 1796 | conf_t *conf = mddev->private; |
1797 | mdk_rdev_t *rdev = conf->mirrors[i].rdev; | 1797 | struct md_rdev *rdev = conf->mirrors[i].rdev; |
1798 | int vcnt, idx; | 1798 | int vcnt, idx; |
1799 | struct bio_vec *vec; | 1799 | struct bio_vec *vec; |
1800 | 1800 | ||
@@ -1871,7 +1871,7 @@ static void handle_sync_write_finished(conf_t *conf, r1bio_t *r1_bio) | |||
1871 | int m; | 1871 | int m; |
1872 | int s = r1_bio->sectors; | 1872 | int s = r1_bio->sectors; |
1873 | for (m = 0; m < conf->raid_disks ; m++) { | 1873 | for (m = 0; m < conf->raid_disks ; m++) { |
1874 | mdk_rdev_t *rdev = conf->mirrors[m].rdev; | 1874 | struct md_rdev *rdev = conf->mirrors[m].rdev; |
1875 | struct bio *bio = r1_bio->bios[m]; | 1875 | struct bio *bio = r1_bio->bios[m]; |
1876 | if (bio->bi_end_io == NULL) | 1876 | if (bio->bi_end_io == NULL) |
1877 | continue; | 1877 | continue; |
@@ -1894,7 +1894,7 @@ static void handle_write_finished(conf_t *conf, r1bio_t *r1_bio) | |||
1894 | int m; | 1894 | int m; |
1895 | for (m = 0; m < conf->raid_disks ; m++) | 1895 | for (m = 0; m < conf->raid_disks ; m++) |
1896 | if (r1_bio->bios[m] == IO_MADE_GOOD) { | 1896 | if (r1_bio->bios[m] == IO_MADE_GOOD) { |
1897 | mdk_rdev_t *rdev = conf->mirrors[m].rdev; | 1897 | struct md_rdev *rdev = conf->mirrors[m].rdev; |
1898 | rdev_clear_badblocks(rdev, | 1898 | rdev_clear_badblocks(rdev, |
1899 | r1_bio->sector, | 1899 | r1_bio->sector, |
1900 | r1_bio->sectors); | 1900 | r1_bio->sectors); |
@@ -1925,7 +1925,7 @@ static void handle_read_error(conf_t *conf, r1bio_t *r1_bio) | |||
1925 | mddev_t *mddev = conf->mddev; | 1925 | mddev_t *mddev = conf->mddev; |
1926 | struct bio *bio; | 1926 | struct bio *bio; |
1927 | char b[BDEVNAME_SIZE]; | 1927 | char b[BDEVNAME_SIZE]; |
1928 | mdk_rdev_t *rdev; | 1928 | struct md_rdev *rdev; |
1929 | 1929 | ||
1930 | clear_bit(R1BIO_ReadError, &r1_bio->state); | 1930 | clear_bit(R1BIO_ReadError, &r1_bio->state); |
1931 | /* we got a read error. Maybe the drive is bad. Maybe just | 1931 | /* we got a read error. Maybe the drive is bad. Maybe just |
@@ -2168,7 +2168,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
2168 | set_bit(R1BIO_IsSync, &r1_bio->state); | 2168 | set_bit(R1BIO_IsSync, &r1_bio->state); |
2169 | 2169 | ||
2170 | for (i=0; i < conf->raid_disks; i++) { | 2170 | for (i=0; i < conf->raid_disks; i++) { |
2171 | mdk_rdev_t *rdev; | 2171 | struct md_rdev *rdev; |
2172 | bio = r1_bio->bios[i]; | 2172 | bio = r1_bio->bios[i]; |
2173 | 2173 | ||
2174 | /* take from bio_init */ | 2174 | /* take from bio_init */ |
@@ -2240,7 +2240,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
2240 | int ok = 1; | 2240 | int ok = 1; |
2241 | for (i = 0 ; i < conf->raid_disks ; i++) | 2241 | for (i = 0 ; i < conf->raid_disks ; i++) |
2242 | if (r1_bio->bios[i]->bi_end_io == end_sync_write) { | 2242 | if (r1_bio->bios[i]->bi_end_io == end_sync_write) { |
2243 | mdk_rdev_t *rdev = | 2243 | struct md_rdev *rdev = |
2244 | rcu_dereference(conf->mirrors[i].rdev); | 2244 | rcu_dereference(conf->mirrors[i].rdev); |
2245 | ok = rdev_set_badblocks(rdev, sector_nr, | 2245 | ok = rdev_set_badblocks(rdev, sector_nr, |
2246 | min_bad, 0 | 2246 | min_bad, 0 |
@@ -2370,7 +2370,7 @@ static conf_t *setup_conf(mddev_t *mddev) | |||
2370 | conf_t *conf; | 2370 | conf_t *conf; |
2371 | int i; | 2371 | int i; |
2372 | mirror_info_t *disk; | 2372 | mirror_info_t *disk; |
2373 | mdk_rdev_t *rdev; | 2373 | struct md_rdev *rdev; |
2374 | int err = -ENOMEM; | 2374 | int err = -ENOMEM; |
2375 | 2375 | ||
2376 | conf = kzalloc(sizeof(conf_t), GFP_KERNEL); | 2376 | conf = kzalloc(sizeof(conf_t), GFP_KERNEL); |
@@ -2470,7 +2470,7 @@ static int run(mddev_t *mddev) | |||
2470 | { | 2470 | { |
2471 | conf_t *conf; | 2471 | conf_t *conf; |
2472 | int i; | 2472 | int i; |
2473 | mdk_rdev_t *rdev; | 2473 | struct md_rdev *rdev; |
2474 | 2474 | ||
2475 | if (mddev->level != 1) { | 2475 | if (mddev->level != 1) { |
2476 | printk(KERN_ERR "md/raid1:%s: raid level not set to mirroring (%d)\n", | 2476 | printk(KERN_ERR "md/raid1:%s: raid level not set to mirroring (%d)\n", |
@@ -2669,7 +2669,7 @@ static int raid1_reshape(mddev_t *mddev) | |||
2669 | conf->r1bio_pool = newpool; | 2669 | conf->r1bio_pool = newpool; |
2670 | 2670 | ||
2671 | for (d = d2 = 0; d < conf->raid_disks; d++) { | 2671 | for (d = d2 = 0; d < conf->raid_disks; d++) { |
2672 | mdk_rdev_t *rdev = conf->mirrors[d].rdev; | 2672 | struct md_rdev *rdev = conf->mirrors[d].rdev; |
2673 | if (rdev && rdev->raid_disk != d2) { | 2673 | if (rdev && rdev->raid_disk != d2) { |
2674 | sysfs_unlink_rdev(mddev, rdev); | 2674 | sysfs_unlink_rdev(mddev, rdev); |
2675 | rdev->raid_disk = d2; | 2675 | rdev->raid_disk = d2; |