aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-10-11 01:47:53 -0400
committerNeilBrown <neilb@suse.de>2011-10-11 01:47:53 -0400
commitfd01b88c75a718020ff77e7f560d33835e9b58de (patch)
treec455d5adefd58f3263dcf265bb8ba2024523b106 /drivers/md/raid10.c
parent3cb03002000f133f9f97269edefd73611eafc873 (diff)
md: remove typedefs: mddev_t -> struct mddev
Having mddev_t and 'struct mddev_s' is ugly and not preferred Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index b3b7238c5416..8c3bd6061f96 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -207,7 +207,7 @@ static void put_buf(r10bio_t *r10_bio)
207static void reschedule_retry(r10bio_t *r10_bio) 207static void reschedule_retry(r10bio_t *r10_bio)
208{ 208{
209 unsigned long flags; 209 unsigned long flags;
210 mddev_t *mddev = r10_bio->mddev; 210 struct mddev *mddev = r10_bio->mddev;
211 conf_t *conf = mddev->private; 211 conf_t *conf = mddev->private;
212 212
213 spin_lock_irqsave(&conf->device_lock, flags); 213 spin_lock_irqsave(&conf->device_lock, flags);
@@ -522,7 +522,7 @@ static int raid10_mergeable_bvec(struct request_queue *q,
522 struct bvec_merge_data *bvm, 522 struct bvec_merge_data *bvm,
523 struct bio_vec *biovec) 523 struct bio_vec *biovec)
524{ 524{
525 mddev_t *mddev = q->queuedata; 525 struct mddev *mddev = q->queuedata;
526 sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev); 526 sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
527 int max; 527 int max;
528 unsigned int chunk_sectors = mddev->chunk_sectors; 528 unsigned int chunk_sectors = mddev->chunk_sectors;
@@ -677,7 +677,7 @@ retry:
677 677
678static int raid10_congested(void *data, int bits) 678static int raid10_congested(void *data, int bits)
679{ 679{
680 mddev_t *mddev = data; 680 struct mddev *mddev = data;
681 conf_t *conf = mddev->private; 681 conf_t *conf = mddev->private;
682 int i, ret = 0; 682 int i, ret = 0;
683 683
@@ -830,7 +830,7 @@ static void unfreeze_array(conf_t *conf)
830 spin_unlock_irq(&conf->resync_lock); 830 spin_unlock_irq(&conf->resync_lock);
831} 831}
832 832
833static int make_request(mddev_t *mddev, struct bio * bio) 833static int make_request(struct mddev *mddev, struct bio * bio)
834{ 834{
835 conf_t *conf = mddev->private; 835 conf_t *conf = mddev->private;
836 mirror_info_t *mirror; 836 mirror_info_t *mirror;
@@ -1161,7 +1161,7 @@ retry_write:
1161 return 0; 1161 return 0;
1162} 1162}
1163 1163
1164static void status(struct seq_file *seq, mddev_t *mddev) 1164static void status(struct seq_file *seq, struct mddev *mddev)
1165{ 1165{
1166 conf_t *conf = mddev->private; 1166 conf_t *conf = mddev->private;
1167 int i; 1167 int i;
@@ -1209,7 +1209,7 @@ static int enough(conf_t *conf, int ignore)
1209 return 1; 1209 return 1;
1210} 1210}
1211 1211
1212static void error(mddev_t *mddev, struct md_rdev *rdev) 1212static void error(struct mddev *mddev, struct md_rdev *rdev)
1213{ 1213{
1214 char b[BDEVNAME_SIZE]; 1214 char b[BDEVNAME_SIZE];
1215 conf_t *conf = mddev->private; 1215 conf_t *conf = mddev->private;
@@ -1279,7 +1279,7 @@ static void close_sync(conf_t *conf)
1279 conf->r10buf_pool = NULL; 1279 conf->r10buf_pool = NULL;
1280} 1280}
1281 1281
1282static int raid10_spare_active(mddev_t *mddev) 1282static int raid10_spare_active(struct mddev *mddev)
1283{ 1283{
1284 int i; 1284 int i;
1285 conf_t *conf = mddev->private; 1285 conf_t *conf = mddev->private;
@@ -1309,7 +1309,7 @@ static int raid10_spare_active(mddev_t *mddev)
1309} 1309}
1310 1310
1311 1311
1312static int raid10_add_disk(mddev_t *mddev, struct md_rdev *rdev) 1312static int raid10_add_disk(struct mddev *mddev, struct md_rdev *rdev)
1313{ 1313{
1314 conf_t *conf = mddev->private; 1314 conf_t *conf = mddev->private;
1315 int err = -EEXIST; 1315 int err = -EEXIST;
@@ -1368,7 +1368,7 @@ static int raid10_add_disk(mddev_t *mddev, struct md_rdev *rdev)
1368 return err; 1368 return err;
1369} 1369}
1370 1370
1371static int raid10_remove_disk(mddev_t *mddev, int number) 1371static int raid10_remove_disk(struct mddev *mddev, int number)
1372{ 1372{
1373 conf_t *conf = mddev->private; 1373 conf_t *conf = mddev->private;
1374 int err = 0; 1374 int err = 0;
@@ -1441,7 +1441,7 @@ static void end_sync_read(struct bio *bio, int error)
1441 1441
1442static void end_sync_request(r10bio_t *r10_bio) 1442static void end_sync_request(r10bio_t *r10_bio)
1443{ 1443{
1444 mddev_t *mddev = r10_bio->mddev; 1444 struct mddev *mddev = r10_bio->mddev;
1445 1445
1446 while (atomic_dec_and_test(&r10_bio->remaining)) { 1446 while (atomic_dec_and_test(&r10_bio->remaining)) {
1447 if (r10_bio->master_bio == NULL) { 1447 if (r10_bio->master_bio == NULL) {
@@ -1470,7 +1470,7 @@ static void end_sync_write(struct bio *bio, int error)
1470{ 1470{
1471 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); 1471 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
1472 r10bio_t *r10_bio = bio->bi_private; 1472 r10bio_t *r10_bio = bio->bi_private;
1473 mddev_t *mddev = r10_bio->mddev; 1473 struct mddev *mddev = r10_bio->mddev;
1474 conf_t *conf = mddev->private; 1474 conf_t *conf = mddev->private;
1475 int d; 1475 int d;
1476 sector_t first_bad; 1476 sector_t first_bad;
@@ -1509,7 +1509,7 @@ static void end_sync_write(struct bio *bio, int error)
1509 * We check if all blocks are in-sync and only write to blocks that 1509 * We check if all blocks are in-sync and only write to blocks that
1510 * aren't in sync 1510 * aren't in sync
1511 */ 1511 */
1512static void sync_request_write(mddev_t *mddev, r10bio_t *r10_bio) 1512static void sync_request_write(struct mddev *mddev, r10bio_t *r10_bio)
1513{ 1513{
1514 conf_t *conf = mddev->private; 1514 conf_t *conf = mddev->private;
1515 int i, first; 1515 int i, first;
@@ -1618,7 +1618,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio)
1618 * If a read fails, record a bad block on both old and 1618 * If a read fails, record a bad block on both old and
1619 * new devices. 1619 * new devices.
1620 */ 1620 */
1621 mddev_t *mddev = r10_bio->mddev; 1621 struct mddev *mddev = r10_bio->mddev;
1622 conf_t *conf = mddev->private; 1622 conf_t *conf = mddev->private;
1623 struct bio *bio = r10_bio->devs[0].bio; 1623 struct bio *bio = r10_bio->devs[0].bio;
1624 sector_t sect = 0; 1624 sector_t sect = 0;
@@ -1688,7 +1688,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio)
1688 } 1688 }
1689} 1689}
1690 1690
1691static void recovery_request_write(mddev_t *mddev, r10bio_t *r10_bio) 1691static void recovery_request_write(struct mddev *mddev, r10bio_t *r10_bio)
1692{ 1692{
1693 conf_t *conf = mddev->private; 1693 conf_t *conf = mddev->private;
1694 int d; 1694 int d;
@@ -1719,7 +1719,7 @@ static void recovery_request_write(mddev_t *mddev, r10bio_t *r10_bio)
1719 * since the last recorded read error. 1719 * since the last recorded read error.
1720 * 1720 *
1721 */ 1721 */
1722static void check_decay_read_errors(mddev_t *mddev, struct md_rdev *rdev) 1722static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev)
1723{ 1723{
1724 struct timespec cur_time_mon; 1724 struct timespec cur_time_mon;
1725 unsigned long hours_since_last; 1725 unsigned long hours_since_last;
@@ -1778,7 +1778,7 @@ static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector,
1778 * 3. Performs writes following reads for array synchronising. 1778 * 3. Performs writes following reads for array synchronising.
1779 */ 1779 */
1780 1780
1781static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio) 1781static void fix_read_error(conf_t *conf, struct mddev *mddev, r10bio_t *r10_bio)
1782{ 1782{
1783 int sect = 0; /* Offset from r10_bio->sector */ 1783 int sect = 0; /* Offset from r10_bio->sector */
1784 int sectors = r10_bio->sectors; 1784 int sectors = r10_bio->sectors;
@@ -1986,7 +1986,7 @@ static int submit_bio_wait(int rw, struct bio *bio)
1986static int narrow_write_error(r10bio_t *r10_bio, int i) 1986static int narrow_write_error(r10bio_t *r10_bio, int i)
1987{ 1987{
1988 struct bio *bio = r10_bio->master_bio; 1988 struct bio *bio = r10_bio->master_bio;
1989 mddev_t *mddev = r10_bio->mddev; 1989 struct mddev *mddev = r10_bio->mddev;
1990 conf_t *conf = mddev->private; 1990 conf_t *conf = mddev->private;
1991 struct md_rdev *rdev = conf->mirrors[r10_bio->devs[i].devnum].rdev; 1991 struct md_rdev *rdev = conf->mirrors[r10_bio->devs[i].devnum].rdev;
1992 /* bio has the data to be written to slot 'i' where 1992 /* bio has the data to be written to slot 'i' where
@@ -2040,7 +2040,7 @@ static int narrow_write_error(r10bio_t *r10_bio, int i)
2040 return ok; 2040 return ok;
2041} 2041}
2042 2042
2043static void handle_read_error(mddev_t *mddev, r10bio_t *r10_bio) 2043static void handle_read_error(struct mddev *mddev, r10bio_t *r10_bio)
2044{ 2044{
2045 int slot = r10_bio->read_slot; 2045 int slot = r10_bio->read_slot;
2046 int mirror = r10_bio->devs[slot].devnum; 2046 int mirror = r10_bio->devs[slot].devnum;
@@ -2200,7 +2200,7 @@ static void handle_write_completed(conf_t *conf, r10bio_t *r10_bio)
2200 } 2200 }
2201} 2201}
2202 2202
2203static void raid10d(mddev_t *mddev) 2203static void raid10d(struct mddev *mddev)
2204{ 2204{
2205 r10bio_t *r10_bio; 2205 r10bio_t *r10_bio;
2206 unsigned long flags; 2206 unsigned long flags;
@@ -2297,7 +2297,7 @@ static int init_resync(conf_t *conf)
2297 * 2297 *
2298 */ 2298 */
2299 2299
2300static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, 2300static sector_t sync_request(struct mddev *mddev, sector_t sector_nr,
2301 int *skipped, int go_faster) 2301 int *skipped, int go_faster)
2302{ 2302{
2303 conf_t *conf = mddev->private; 2303 conf_t *conf = mddev->private;
@@ -2714,7 +2714,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr,
2714} 2714}
2715 2715
2716static sector_t 2716static sector_t
2717raid10_size(mddev_t *mddev, sector_t sectors, int raid_disks) 2717raid10_size(struct mddev *mddev, sector_t sectors, int raid_disks)
2718{ 2718{
2719 sector_t size; 2719 sector_t size;
2720 conf_t *conf = mddev->private; 2720 conf_t *conf = mddev->private;
@@ -2733,7 +2733,7 @@ raid10_size(mddev_t *mddev, sector_t sectors, int raid_disks)
2733} 2733}
2734 2734
2735 2735
2736static conf_t *setup_conf(mddev_t *mddev) 2736static conf_t *setup_conf(struct mddev *mddev)
2737{ 2737{
2738 conf_t *conf = NULL; 2738 conf_t *conf = NULL;
2739 int nc, fc, fo; 2739 int nc, fc, fo;
@@ -2836,7 +2836,7 @@ static conf_t *setup_conf(mddev_t *mddev)
2836 return ERR_PTR(err); 2836 return ERR_PTR(err);
2837} 2837}
2838 2838
2839static int run(mddev_t *mddev) 2839static int run(struct mddev *mddev)
2840{ 2840{
2841 conf_t *conf; 2841 conf_t *conf;
2842 int i, disk_idx, chunk_size; 2842 int i, disk_idx, chunk_size;
@@ -2966,7 +2966,7 @@ out:
2966 return -EIO; 2966 return -EIO;
2967} 2967}
2968 2968
2969static int stop(mddev_t *mddev) 2969static int stop(struct mddev *mddev)
2970{ 2970{
2971 conf_t *conf = mddev->private; 2971 conf_t *conf = mddev->private;
2972 2972
@@ -2983,7 +2983,7 @@ static int stop(mddev_t *mddev)
2983 return 0; 2983 return 0;
2984} 2984}
2985 2985
2986static void raid10_quiesce(mddev_t *mddev, int state) 2986static void raid10_quiesce(struct mddev *mddev, int state)
2987{ 2987{
2988 conf_t *conf = mddev->private; 2988 conf_t *conf = mddev->private;
2989 2989
@@ -2997,7 +2997,7 @@ static void raid10_quiesce(mddev_t *mddev, int state)
2997 } 2997 }
2998} 2998}
2999 2999
3000static void *raid10_takeover_raid0(mddev_t *mddev) 3000static void *raid10_takeover_raid0(struct mddev *mddev)
3001{ 3001{
3002 struct md_rdev *rdev; 3002 struct md_rdev *rdev;
3003 conf_t *conf; 3003 conf_t *conf;
@@ -3029,7 +3029,7 @@ static void *raid10_takeover_raid0(mddev_t *mddev)
3029 return conf; 3029 return conf;
3030} 3030}
3031 3031
3032static void *raid10_takeover(mddev_t *mddev) 3032static void *raid10_takeover(struct mddev *mddev)
3033{ 3033{
3034 struct raid0_private_data *raid0_priv; 3034 struct raid0_private_data *raid0_priv;
3035 3035