diff options
| author | NeilBrown <neilb@suse.de> | 2011-10-11 01:49:05 -0400 |
|---|---|---|
| committer | NeilBrown <neilb@suse.de> | 2011-10-11 01:49:05 -0400 |
| commit | e8096360476689898f038feebf5b352c9ec43a2a (patch) | |
| tree | e7570a5fc3cb0e40f29c55470a2261e03c44a8d1 | |
| parent | e879a8793f915aa7933364d962d2435bd71de462 (diff) | |
md/raid1: typedef removal: conf_t -> struct r1conf
Signed-off-by: NeilBrown <neilb@suse.de>
| -rw-r--r-- | drivers/md/raid1.c | 94 | ||||
| -rw-r--r-- | drivers/md/raid1.h | 4 |
2 files changed, 48 insertions, 50 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index f6eabeb21281..e09f59545e97 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
| @@ -46,8 +46,8 @@ | |||
| 46 | #define NR_RAID1_BIOS 256 | 46 | #define NR_RAID1_BIOS 256 |
| 47 | 47 | ||
| 48 | 48 | ||
| 49 | static void allow_barrier(conf_t *conf); | 49 | static void allow_barrier(struct r1conf *conf); |
| 50 | static void lower_barrier(conf_t *conf); | 50 | static void lower_barrier(struct r1conf *conf); |
| 51 | 51 | ||
| 52 | static void * r1bio_pool_alloc(gfp_t gfp_flags, void *data) | 52 | static void * r1bio_pool_alloc(gfp_t gfp_flags, void *data) |
| 53 | { | 53 | { |
| @@ -154,7 +154,7 @@ static void r1buf_pool_free(void *__r1_bio, void *data) | |||
| 154 | r1bio_pool_free(r1bio, data); | 154 | r1bio_pool_free(r1bio, data); |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | static void put_all_bios(conf_t *conf, struct r1bio *r1_bio) | 157 | static void put_all_bios(struct r1conf *conf, struct r1bio *r1_bio) |
| 158 | { | 158 | { |
| 159 | int i; | 159 | int i; |
| 160 | 160 | ||
| @@ -168,7 +168,7 @@ static void put_all_bios(conf_t *conf, struct r1bio *r1_bio) | |||
| 168 | 168 | ||
| 169 | static void free_r1bio(struct r1bio *r1_bio) | 169 | static void free_r1bio(struct r1bio *r1_bio) |
| 170 | { | 170 | { |
| 171 | conf_t *conf = r1_bio->mddev->private; | 171 | struct r1conf *conf = r1_bio->mddev->private; |
| 172 | 172 | ||
| 173 | put_all_bios(conf, r1_bio); | 173 | put_all_bios(conf, r1_bio); |
| 174 | mempool_free(r1_bio, conf->r1bio_pool); | 174 | mempool_free(r1_bio, conf->r1bio_pool); |
| @@ -176,7 +176,7 @@ static void free_r1bio(struct r1bio *r1_bio) | |||
| 176 | 176 | ||
| 177 | static void put_buf(struct r1bio *r1_bio) | 177 | static void put_buf(struct r1bio *r1_bio) |
| 178 | { | 178 | { |
| 179 | conf_t *conf = r1_bio->mddev->private; | 179 | struct r1conf *conf = r1_bio->mddev->private; |
| 180 | int i; | 180 | int i; |
| 181 | 181 | ||
| 182 | for (i=0; i<conf->raid_disks; i++) { | 182 | for (i=0; i<conf->raid_disks; i++) { |
| @@ -194,7 +194,7 @@ static void reschedule_retry(struct r1bio *r1_bio) | |||
| 194 | { | 194 | { |
| 195 | unsigned long flags; | 195 | unsigned long flags; |
| 196 | struct mddev *mddev = r1_bio->mddev; | 196 | struct mddev *mddev = r1_bio->mddev; |
| 197 | conf_t *conf = mddev->private; | 197 | struct r1conf *conf = mddev->private; |
| 198 | 198 | ||
| 199 | spin_lock_irqsave(&conf->device_lock, flags); | 199 | spin_lock_irqsave(&conf->device_lock, flags); |
| 200 | list_add(&r1_bio->retry_list, &conf->retry_list); | 200 | list_add(&r1_bio->retry_list, &conf->retry_list); |
| @@ -214,7 +214,7 @@ static void call_bio_endio(struct r1bio *r1_bio) | |||
| 214 | { | 214 | { |
| 215 | struct bio *bio = r1_bio->master_bio; | 215 | struct bio *bio = r1_bio->master_bio; |
| 216 | int done; | 216 | int done; |
| 217 | conf_t *conf = r1_bio->mddev->private; | 217 | struct r1conf *conf = r1_bio->mddev->private; |
| 218 | 218 | ||
| 219 | if (bio->bi_phys_segments) { | 219 | if (bio->bi_phys_segments) { |
| 220 | unsigned long flags; | 220 | unsigned long flags; |
| @@ -259,7 +259,7 @@ static void raid_end_bio_io(struct r1bio *r1_bio) | |||
| 259 | */ | 259 | */ |
| 260 | static inline void update_head_pos(int disk, struct r1bio *r1_bio) | 260 | static inline void update_head_pos(int disk, struct r1bio *r1_bio) |
| 261 | { | 261 | { |
| 262 | conf_t *conf = r1_bio->mddev->private; | 262 | struct r1conf *conf = r1_bio->mddev->private; |
| 263 | 263 | ||
| 264 | conf->mirrors[disk].head_position = | 264 | conf->mirrors[disk].head_position = |
| 265 | r1_bio->sector + (r1_bio->sectors); | 265 | r1_bio->sector + (r1_bio->sectors); |
| @@ -288,7 +288,7 @@ static void raid1_end_read_request(struct bio *bio, int error) | |||
| 288 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); | 288 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); |
| 289 | struct r1bio *r1_bio = bio->bi_private; | 289 | struct r1bio *r1_bio = bio->bi_private; |
| 290 | int mirror; | 290 | int mirror; |
| 291 | conf_t *conf = r1_bio->mddev->private; | 291 | struct r1conf *conf = r1_bio->mddev->private; |
| 292 | 292 | ||
| 293 | mirror = r1_bio->read_disk; | 293 | mirror = r1_bio->read_disk; |
| 294 | /* | 294 | /* |
| @@ -373,7 +373,7 @@ static void raid1_end_write_request(struct bio *bio, int error) | |||
| 373 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); | 373 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); |
| 374 | struct r1bio *r1_bio = bio->bi_private; | 374 | struct r1bio *r1_bio = bio->bi_private; |
| 375 | int mirror, behind = test_bit(R1BIO_BehindIO, &r1_bio->state); | 375 | int mirror, behind = test_bit(R1BIO_BehindIO, &r1_bio->state); |
| 376 | conf_t *conf = r1_bio->mddev->private; | 376 | struct r1conf *conf = r1_bio->mddev->private; |
| 377 | struct bio *to_put = NULL; | 377 | struct bio *to_put = NULL; |
| 378 | 378 | ||
| 379 | mirror = find_bio_disk(r1_bio, bio); | 379 | mirror = find_bio_disk(r1_bio, bio); |
| @@ -466,7 +466,7 @@ static void raid1_end_write_request(struct bio *bio, int error) | |||
| 466 | * | 466 | * |
| 467 | * The rdev for the device selected will have nr_pending incremented. | 467 | * The rdev for the device selected will have nr_pending incremented. |
| 468 | */ | 468 | */ |
| 469 | static int read_balance(conf_t *conf, struct r1bio *r1_bio, int *max_sectors) | 469 | static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sectors) |
| 470 | { | 470 | { |
| 471 | const sector_t this_sector = r1_bio->sector; | 471 | const sector_t this_sector = r1_bio->sector; |
| 472 | int sectors; | 472 | int sectors; |
| @@ -595,7 +595,7 @@ static int read_balance(conf_t *conf, struct r1bio *r1_bio, int *max_sectors) | |||
| 595 | 595 | ||
| 596 | int md_raid1_congested(struct mddev *mddev, int bits) | 596 | int md_raid1_congested(struct mddev *mddev, int bits) |
| 597 | { | 597 | { |
| 598 | conf_t *conf = mddev->private; | 598 | struct r1conf *conf = mddev->private; |
| 599 | int i, ret = 0; | 599 | int i, ret = 0; |
| 600 | 600 | ||
| 601 | rcu_read_lock(); | 601 | rcu_read_lock(); |
| @@ -628,7 +628,7 @@ static int raid1_congested(void *data, int bits) | |||
| 628 | md_raid1_congested(mddev, bits); | 628 | md_raid1_congested(mddev, bits); |
| 629 | } | 629 | } |
| 630 | 630 | ||
| 631 | static void flush_pending_writes(conf_t *conf) | 631 | static void flush_pending_writes(struct r1conf *conf) |
| 632 | { | 632 | { |
| 633 | /* Any writes that have been queued but are awaiting | 633 | /* Any writes that have been queued but are awaiting |
| 634 | * bitmap updates get flushed here. | 634 | * bitmap updates get flushed here. |
| @@ -676,7 +676,7 @@ static void flush_pending_writes(conf_t *conf) | |||
| 676 | */ | 676 | */ |
| 677 | #define RESYNC_DEPTH 32 | 677 | #define RESYNC_DEPTH 32 |
| 678 | 678 | ||
| 679 | static void raise_barrier(conf_t *conf) | 679 | static void raise_barrier(struct r1conf *conf) |
| 680 | { | 680 | { |
| 681 | spin_lock_irq(&conf->resync_lock); | 681 | spin_lock_irq(&conf->resync_lock); |
| 682 | 682 | ||
| @@ -695,7 +695,7 @@ static void raise_barrier(conf_t *conf) | |||
| 695 | spin_unlock_irq(&conf->resync_lock); | 695 | spin_unlock_irq(&conf->resync_lock); |
| 696 | } | 696 | } |
| 697 | 697 | ||
| 698 | static void lower_barrier(conf_t *conf) | 698 | static void lower_barrier(struct r1conf *conf) |
| 699 | { | 699 | { |
| 700 | unsigned long flags; | 700 | unsigned long flags; |
| 701 | BUG_ON(conf->barrier <= 0); | 701 | BUG_ON(conf->barrier <= 0); |
| @@ -705,7 +705,7 @@ static void lower_barrier(conf_t *conf) | |||
| 705 | wake_up(&conf->wait_barrier); | 705 | wake_up(&conf->wait_barrier); |
| 706 | } | 706 | } |
| 707 | 707 | ||
| 708 | static void wait_barrier(conf_t *conf) | 708 | static void wait_barrier(struct r1conf *conf) |
| 709 | { | 709 | { |
| 710 | spin_lock_irq(&conf->resync_lock); | 710 | spin_lock_irq(&conf->resync_lock); |
| 711 | if (conf->barrier) { | 711 | if (conf->barrier) { |
| @@ -719,7 +719,7 @@ static void wait_barrier(conf_t *conf) | |||
| 719 | spin_unlock_irq(&conf->resync_lock); | 719 | spin_unlock_irq(&conf->resync_lock); |
| 720 | } | 720 | } |
| 721 | 721 | ||
| 722 | static void allow_barrier(conf_t *conf) | 722 | static void allow_barrier(struct r1conf *conf) |
| 723 | { | 723 | { |
| 724 | unsigned long flags; | 724 | unsigned long flags; |
| 725 | spin_lock_irqsave(&conf->resync_lock, flags); | 725 | spin_lock_irqsave(&conf->resync_lock, flags); |
| @@ -728,7 +728,7 @@ static void allow_barrier(conf_t *conf) | |||
| 728 | wake_up(&conf->wait_barrier); | 728 | wake_up(&conf->wait_barrier); |
| 729 | } | 729 | } |
| 730 | 730 | ||
| 731 | static void freeze_array(conf_t *conf) | 731 | static void freeze_array(struct r1conf *conf) |
| 732 | { | 732 | { |
| 733 | /* stop syncio and normal IO and wait for everything to | 733 | /* stop syncio and normal IO and wait for everything to |
| 734 | * go quite. | 734 | * go quite. |
| @@ -751,7 +751,7 @@ static void freeze_array(conf_t *conf) | |||
| 751 | flush_pending_writes(conf)); | 751 | flush_pending_writes(conf)); |
| 752 | spin_unlock_irq(&conf->resync_lock); | 752 | spin_unlock_irq(&conf->resync_lock); |
| 753 | } | 753 | } |
| 754 | static void unfreeze_array(conf_t *conf) | 754 | static void unfreeze_array(struct r1conf *conf) |
| 755 | { | 755 | { |
| 756 | /* reverse the effect of the freeze */ | 756 | /* reverse the effect of the freeze */ |
| 757 | spin_lock_irq(&conf->resync_lock); | 757 | spin_lock_irq(&conf->resync_lock); |
| @@ -798,7 +798,7 @@ do_sync_io: | |||
| 798 | 798 | ||
| 799 | static int make_request(struct mddev *mddev, struct bio * bio) | 799 | static int make_request(struct mddev *mddev, struct bio * bio) |
| 800 | { | 800 | { |
| 801 | conf_t *conf = mddev->private; | 801 | struct r1conf *conf = mddev->private; |
| 802 | struct mirror_info *mirror; | 802 | struct mirror_info *mirror; |
| 803 | struct r1bio *r1_bio; | 803 | struct r1bio *r1_bio; |
| 804 | struct bio *read_bio; | 804 | struct bio *read_bio; |
| @@ -1140,7 +1140,7 @@ read_again: | |||
| 1140 | 1140 | ||
| 1141 | static void status(struct seq_file *seq, struct mddev *mddev) | 1141 | static void status(struct seq_file *seq, struct mddev *mddev) |
| 1142 | { | 1142 | { |
| 1143 | conf_t *conf = mddev->private; | 1143 | struct r1conf *conf = mddev->private; |
| 1144 | int i; | 1144 | int i; |
| 1145 | 1145 | ||
| 1146 | seq_printf(seq, " [%d/%d] [", conf->raid_disks, | 1146 | seq_printf(seq, " [%d/%d] [", conf->raid_disks, |
| @@ -1159,7 +1159,7 @@ static void status(struct seq_file *seq, struct mddev *mddev) | |||
| 1159 | static void error(struct mddev *mddev, struct md_rdev *rdev) | 1159 | static void error(struct mddev *mddev, struct md_rdev *rdev) |
| 1160 | { | 1160 | { |
| 1161 | char b[BDEVNAME_SIZE]; | 1161 | char b[BDEVNAME_SIZE]; |
| 1162 | conf_t *conf = mddev->private; | 1162 | struct r1conf *conf = mddev->private; |
| 1163 | 1163 | ||
| 1164 | /* | 1164 | /* |
| 1165 | * If it is not operational, then we have already marked it as dead | 1165 | * If it is not operational, then we have already marked it as dead |
| @@ -1199,7 +1199,7 @@ static void error(struct mddev *mddev, struct md_rdev *rdev) | |||
| 1199 | mdname(mddev), conf->raid_disks - mddev->degraded); | 1199 | mdname(mddev), conf->raid_disks - mddev->degraded); |
| 1200 | } | 1200 | } |
| 1201 | 1201 | ||
| 1202 | static void print_conf(conf_t *conf) | 1202 | static void print_conf(struct r1conf *conf) |
| 1203 | { | 1203 | { |
| 1204 | int i; | 1204 | int i; |
| 1205 | 1205 | ||
| @@ -1224,7 +1224,7 @@ static void print_conf(conf_t *conf) | |||
| 1224 | rcu_read_unlock(); | 1224 | rcu_read_unlock(); |
| 1225 | } | 1225 | } |
| 1226 | 1226 | ||
| 1227 | static void close_sync(conf_t *conf) | 1227 | static void close_sync(struct r1conf *conf) |
| 1228 | { | 1228 | { |
| 1229 | wait_barrier(conf); | 1229 | wait_barrier(conf); |
| 1230 | allow_barrier(conf); | 1230 | allow_barrier(conf); |
| @@ -1236,7 +1236,7 @@ static void close_sync(conf_t *conf) | |||
| 1236 | static int raid1_spare_active(struct mddev *mddev) | 1236 | static int raid1_spare_active(struct mddev *mddev) |
| 1237 | { | 1237 | { |
| 1238 | int i; | 1238 | int i; |
| 1239 | conf_t *conf = mddev->private; | 1239 | struct r1conf *conf = mddev->private; |
| 1240 | int count = 0; | 1240 | int count = 0; |
| 1241 | unsigned long flags; | 1241 | unsigned long flags; |
| 1242 | 1242 | ||
| @@ -1265,7 +1265,7 @@ static int raid1_spare_active(struct mddev *mddev) | |||
| 1265 | 1265 | ||
| 1266 | static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev) | 1266 | static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev) |
| 1267 | { | 1267 | { |
| 1268 | conf_t *conf = mddev->private; | 1268 | struct r1conf *conf = mddev->private; |
| 1269 | int err = -EEXIST; | 1269 | int err = -EEXIST; |
| 1270 | int mirror = 0; | 1270 | int mirror = 0; |
| 1271 | struct mirror_info *p; | 1271 | struct mirror_info *p; |
| @@ -1313,7 +1313,7 @@ static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev) | |||
| 1313 | 1313 | ||
| 1314 | static int raid1_remove_disk(struct mddev *mddev, int number) | 1314 | static int raid1_remove_disk(struct mddev *mddev, int number) |
| 1315 | { | 1315 | { |
| 1316 | conf_t *conf = mddev->private; | 1316 | struct r1conf *conf = mddev->private; |
| 1317 | int err = 0; | 1317 | int err = 0; |
| 1318 | struct md_rdev *rdev; | 1318 | struct md_rdev *rdev; |
| 1319 | struct mirror_info *p = conf->mirrors+ number; | 1319 | struct mirror_info *p = conf->mirrors+ number; |
| @@ -1375,7 +1375,7 @@ static void end_sync_write(struct bio *bio, int error) | |||
| 1375 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); | 1375 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); |
| 1376 | struct r1bio *r1_bio = bio->bi_private; | 1376 | struct r1bio *r1_bio = bio->bi_private; |
| 1377 | struct mddev *mddev = r1_bio->mddev; | 1377 | struct mddev *mddev = r1_bio->mddev; |
| 1378 | conf_t *conf = mddev->private; | 1378 | struct r1conf *conf = mddev->private; |
| 1379 | int mirror=0; | 1379 | int mirror=0; |
| 1380 | sector_t first_bad; | 1380 | sector_t first_bad; |
| 1381 | int bad_sectors; | 1381 | int bad_sectors; |
| @@ -1447,7 +1447,7 @@ static int fix_sync_read_error(struct r1bio *r1_bio) | |||
| 1447 | * will have bi_end_io clear. | 1447 | * will have bi_end_io clear. |
| 1448 | */ | 1448 | */ |
| 1449 | struct mddev *mddev = r1_bio->mddev; | 1449 | struct mddev *mddev = r1_bio->mddev; |
| 1450 | conf_t *conf = mddev->private; | 1450 | struct r1conf *conf = mddev->private; |
| 1451 | struct bio *bio = r1_bio->bios[r1_bio->read_disk]; | 1451 | struct bio *bio = r1_bio->bios[r1_bio->read_disk]; |
| 1452 | sector_t sect = r1_bio->sector; | 1452 | sector_t sect = r1_bio->sector; |
| 1453 | int sectors = r1_bio->sectors; | 1453 | int sectors = r1_bio->sectors; |
| @@ -1563,7 +1563,7 @@ static int process_checks(struct r1bio *r1_bio) | |||
| 1563 | * attempt an over-write | 1563 | * attempt an over-write |
| 1564 | */ | 1564 | */ |
| 1565 | struct mddev *mddev = r1_bio->mddev; | 1565 | struct mddev *mddev = r1_bio->mddev; |
| 1566 | conf_t *conf = mddev->private; | 1566 | struct r1conf *conf = mddev->private; |
| 1567 | int primary; | 1567 | int primary; |
| 1568 | int i; | 1568 | int i; |
| 1569 | 1569 | ||
| @@ -1637,7 +1637,7 @@ static int process_checks(struct r1bio *r1_bio) | |||
| 1637 | 1637 | ||
| 1638 | static void sync_request_write(struct mddev *mddev, struct r1bio *r1_bio) | 1638 | static void sync_request_write(struct mddev *mddev, struct r1bio *r1_bio) |
| 1639 | { | 1639 | { |
| 1640 | conf_t *conf = mddev->private; | 1640 | struct r1conf *conf = mddev->private; |
| 1641 | int i; | 1641 | int i; |
| 1642 | int disks = conf->raid_disks; | 1642 | int disks = conf->raid_disks; |
| 1643 | struct bio *bio, *wbio; | 1643 | struct bio *bio, *wbio; |
| @@ -1687,7 +1687,7 @@ static void sync_request_write(struct mddev *mddev, struct r1bio *r1_bio) | |||
| 1687 | * 3. Performs writes following reads for array synchronising. | 1687 | * 3. Performs writes following reads for array synchronising. |
| 1688 | */ | 1688 | */ |
| 1689 | 1689 | ||
| 1690 | static void fix_read_error(conf_t *conf, int read_disk, | 1690 | static void fix_read_error(struct r1conf *conf, int read_disk, |
| 1691 | sector_t sect, int sectors) | 1691 | sector_t sect, int sectors) |
| 1692 | { | 1692 | { |
| 1693 | struct mddev *mddev = conf->mddev; | 1693 | struct mddev *mddev = conf->mddev; |
| @@ -1793,7 +1793,7 @@ static int submit_bio_wait(int rw, struct bio *bio) | |||
| 1793 | static int narrow_write_error(struct r1bio *r1_bio, int i) | 1793 | static int narrow_write_error(struct r1bio *r1_bio, int i) |
| 1794 | { | 1794 | { |
| 1795 | struct mddev *mddev = r1_bio->mddev; | 1795 | struct mddev *mddev = r1_bio->mddev; |
| 1796 | conf_t *conf = mddev->private; | 1796 | struct r1conf *conf = mddev->private; |
| 1797 | struct md_rdev *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; |
| @@ -1866,7 +1866,7 @@ static int narrow_write_error(struct r1bio *r1_bio, int i) | |||
| 1866 | return ok; | 1866 | return ok; |
| 1867 | } | 1867 | } |
| 1868 | 1868 | ||
| 1869 | static void handle_sync_write_finished(conf_t *conf, struct r1bio *r1_bio) | 1869 | static void handle_sync_write_finished(struct r1conf *conf, struct r1bio *r1_bio) |
| 1870 | { | 1870 | { |
| 1871 | int m; | 1871 | int m; |
| 1872 | int s = r1_bio->sectors; | 1872 | int s = r1_bio->sectors; |
| @@ -1889,7 +1889,7 @@ static void handle_sync_write_finished(conf_t *conf, struct r1bio *r1_bio) | |||
| 1889 | md_done_sync(conf->mddev, s, 1); | 1889 | md_done_sync(conf->mddev, s, 1); |
| 1890 | } | 1890 | } |
| 1891 | 1891 | ||
| 1892 | static void handle_write_finished(conf_t *conf, struct r1bio *r1_bio) | 1892 | static void handle_write_finished(struct r1conf *conf, struct r1bio *r1_bio) |
| 1893 | { | 1893 | { |
| 1894 | int m; | 1894 | int m; |
| 1895 | for (m = 0; m < conf->raid_disks ; m++) | 1895 | for (m = 0; m < conf->raid_disks ; m++) |
| @@ -1918,7 +1918,7 @@ static void handle_write_finished(conf_t *conf, struct r1bio *r1_bio) | |||
| 1918 | raid_end_bio_io(r1_bio); | 1918 | raid_end_bio_io(r1_bio); |
| 1919 | } | 1919 | } |
| 1920 | 1920 | ||
| 1921 | static void handle_read_error(conf_t *conf, struct r1bio *r1_bio) | 1921 | static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio) |
| 1922 | { | 1922 | { |
| 1923 | int disk; | 1923 | int disk; |
| 1924 | int max_sectors; | 1924 | int max_sectors; |
| @@ -2012,7 +2012,7 @@ static void raid1d(struct mddev *mddev) | |||
| 2012 | { | 2012 | { |
| 2013 | struct r1bio *r1_bio; | 2013 | struct r1bio *r1_bio; |
| 2014 | unsigned long flags; | 2014 | unsigned long flags; |
| 2015 | conf_t *conf = mddev->private; | 2015 | struct r1conf *conf = mddev->private; |
| 2016 | struct list_head *head = &conf->retry_list; | 2016 | struct list_head *head = &conf->retry_list; |
| 2017 | struct blk_plug plug; | 2017 | struct blk_plug plug; |
| 2018 | 2018 | ||
| @@ -2061,7 +2061,7 @@ static void raid1d(struct mddev *mddev) | |||
| 2061 | } | 2061 | } |
| 2062 | 2062 | ||
| 2063 | 2063 | ||
| 2064 | static int init_resync(conf_t *conf) | 2064 | static int init_resync(struct r1conf *conf) |
| 2065 | { | 2065 | { |
| 2066 | int buffs; | 2066 | int buffs; |
| 2067 | 2067 | ||
| @@ -2087,7 +2087,7 @@ static int init_resync(conf_t *conf) | |||
| 2087 | 2087 | ||
| 2088 | static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipped, int go_faster) | 2088 | static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipped, int go_faster) |
| 2089 | { | 2089 | { |
| 2090 | conf_t *conf = mddev->private; | 2090 | struct r1conf *conf = mddev->private; |
| 2091 | struct r1bio *r1_bio; | 2091 | struct r1bio *r1_bio; |
| 2092 | struct bio *bio; | 2092 | struct bio *bio; |
| 2093 | sector_t max_sector, nr_sectors; | 2093 | sector_t max_sector, nr_sectors; |
| @@ -2365,15 +2365,15 @@ static sector_t raid1_size(struct mddev *mddev, sector_t sectors, int raid_disks | |||
| 2365 | return mddev->dev_sectors; | 2365 | return mddev->dev_sectors; |
| 2366 | } | 2366 | } |
| 2367 | 2367 | ||
| 2368 | static conf_t *setup_conf(struct mddev *mddev) | 2368 | static struct r1conf *setup_conf(struct mddev *mddev) |
| 2369 | { | 2369 | { |
| 2370 | conf_t *conf; | 2370 | struct r1conf *conf; |
| 2371 | int i; | 2371 | int i; |
| 2372 | struct mirror_info *disk; | 2372 | struct mirror_info *disk; |
| 2373 | struct md_rdev *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(struct r1conf), GFP_KERNEL); |
| 2377 | if (!conf) | 2377 | if (!conf) |
| 2378 | goto abort; | 2378 | goto abort; |
| 2379 | 2379 | ||
| @@ -2468,7 +2468,7 @@ static conf_t *setup_conf(struct mddev *mddev) | |||
| 2468 | 2468 | ||
| 2469 | static int run(struct mddev *mddev) | 2469 | static int run(struct mddev *mddev) |
| 2470 | { | 2470 | { |
| 2471 | conf_t *conf; | 2471 | struct r1conf *conf; |
| 2472 | int i; | 2472 | int i; |
| 2473 | struct md_rdev *rdev; | 2473 | struct md_rdev *rdev; |
| 2474 | 2474 | ||
| @@ -2548,7 +2548,7 @@ static int run(struct mddev *mddev) | |||
| 2548 | 2548 | ||
| 2549 | static int stop(struct mddev *mddev) | 2549 | static int stop(struct mddev *mddev) |
| 2550 | { | 2550 | { |
| 2551 | conf_t *conf = mddev->private; | 2551 | struct r1conf *conf = mddev->private; |
| 2552 | struct bitmap *bitmap = mddev->bitmap; | 2552 | struct bitmap *bitmap = mddev->bitmap; |
| 2553 | 2553 | ||
| 2554 | /* wait for behind writes to complete */ | 2554 | /* wait for behind writes to complete */ |
| @@ -2613,7 +2613,7 @@ static int raid1_reshape(struct mddev *mddev) | |||
| 2613 | mempool_t *newpool, *oldpool; | 2613 | mempool_t *newpool, *oldpool; |
| 2614 | struct pool_info *newpoolinfo; | 2614 | struct pool_info *newpoolinfo; |
| 2615 | struct mirror_info *newmirrors; | 2615 | struct mirror_info *newmirrors; |
| 2616 | conf_t *conf = mddev->private; | 2616 | struct r1conf *conf = mddev->private; |
| 2617 | int cnt, raid_disks; | 2617 | int cnt, raid_disks; |
| 2618 | unsigned long flags; | 2618 | unsigned long flags; |
| 2619 | int d, d2, err; | 2619 | int d, d2, err; |
| @@ -2705,7 +2705,7 @@ static int raid1_reshape(struct mddev *mddev) | |||
| 2705 | 2705 | ||
| 2706 | static void raid1_quiesce(struct mddev *mddev, int state) | 2706 | static void raid1_quiesce(struct mddev *mddev, int state) |
| 2707 | { | 2707 | { |
| 2708 | conf_t *conf = mddev->private; | 2708 | struct r1conf *conf = mddev->private; |
| 2709 | 2709 | ||
| 2710 | switch(state) { | 2710 | switch(state) { |
| 2711 | case 2: /* wake for suspend */ | 2711 | case 2: /* wake for suspend */ |
| @@ -2726,7 +2726,7 @@ static void *raid1_takeover(struct mddev *mddev) | |||
| 2726 | * raid5 with 2 devices, any layout or chunk size | 2726 | * raid5 with 2 devices, any layout or chunk size |
| 2727 | */ | 2727 | */ |
| 2728 | if (mddev->level == 5 && mddev->raid_disks == 2) { | 2728 | if (mddev->level == 5 && mddev->raid_disks == 2) { |
| 2729 | conf_t *conf; | 2729 | struct r1conf *conf; |
| 2730 | mddev->new_level = 1; | 2730 | mddev->new_level = 1; |
| 2731 | mddev->new_layout = 0; | 2731 | mddev->new_layout = 0; |
| 2732 | mddev->new_chunk_sectors = 0; | 2732 | mddev->new_chunk_sectors = 0; |
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h index dd5e66a4163f..5b16d09817df 100644 --- a/drivers/md/raid1.h +++ b/drivers/md/raid1.h | |||
| @@ -19,7 +19,7 @@ struct pool_info { | |||
| 19 | int raid_disks; | 19 | int raid_disks; |
| 20 | }; | 20 | }; |
| 21 | 21 | ||
| 22 | struct r1_private_data_s { | 22 | struct r1conf { |
| 23 | struct mddev *mddev; | 23 | struct mddev *mddev; |
| 24 | struct mirror_info *mirrors; | 24 | struct mirror_info *mirrors; |
| 25 | int raid_disks; | 25 | int raid_disks; |
| @@ -90,8 +90,6 @@ struct r1_private_data_s { | |||
| 90 | struct md_thread *thread; | 90 | struct md_thread *thread; |
| 91 | }; | 91 | }; |
| 92 | 92 | ||
| 93 | typedef struct r1_private_data_s conf_t; | ||
| 94 | |||
| 95 | /* | 93 | /* |
| 96 | * this is our 'private' RAID1 bio. | 94 | * this is our 'private' RAID1 bio. |
| 97 | * | 95 | * |
