aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.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/raid1.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/raid1.c')
-rw-r--r--drivers/md/raid1.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index de7d2b677066..50bd7c9411b9 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -193,7 +193,7 @@ static void put_buf(r1bio_t *r1_bio)
193static void reschedule_retry(r1bio_t *r1_bio) 193static void reschedule_retry(r1bio_t *r1_bio)
194{ 194{
195 unsigned long flags; 195 unsigned long flags;
196 mddev_t *mddev = r1_bio->mddev; 196 struct mddev *mddev = r1_bio->mddev;
197 conf_t *conf = mddev->private; 197 conf_t *conf = mddev->private;
198 198
199 spin_lock_irqsave(&conf->device_lock, flags); 199 spin_lock_irqsave(&conf->device_lock, flags);
@@ -593,7 +593,7 @@ static int read_balance(conf_t *conf, r1bio_t *r1_bio, int *max_sectors)
593 return best_disk; 593 return best_disk;
594} 594}
595 595
596int md_raid1_congested(mddev_t *mddev, int bits) 596int md_raid1_congested(struct mddev *mddev, int bits)
597{ 597{
598 conf_t *conf = mddev->private; 598 conf_t *conf = mddev->private;
599 int i, ret = 0; 599 int i, ret = 0;
@@ -622,7 +622,7 @@ EXPORT_SYMBOL_GPL(md_raid1_congested);
622 622
623static int raid1_congested(void *data, int bits) 623static int raid1_congested(void *data, int bits)
624{ 624{
625 mddev_t *mddev = data; 625 struct mddev *mddev = data;
626 626
627 return mddev_congested(mddev, bits) || 627 return mddev_congested(mddev, bits) ||
628 md_raid1_congested(mddev, bits); 628 md_raid1_congested(mddev, bits);
@@ -796,7 +796,7 @@ do_sync_io:
796 pr_debug("%dB behind alloc failed, doing sync I/O\n", bio->bi_size); 796 pr_debug("%dB behind alloc failed, doing sync I/O\n", bio->bi_size);
797} 797}
798 798
799static int make_request(mddev_t *mddev, struct bio * bio) 799static int make_request(struct mddev *mddev, struct bio * bio)
800{ 800{
801 conf_t *conf = mddev->private; 801 conf_t *conf = mddev->private;
802 mirror_info_t *mirror; 802 mirror_info_t *mirror;
@@ -1138,7 +1138,7 @@ read_again:
1138 return 0; 1138 return 0;
1139} 1139}
1140 1140
1141static void status(struct seq_file *seq, mddev_t *mddev) 1141static void status(struct seq_file *seq, struct mddev *mddev)
1142{ 1142{
1143 conf_t *conf = mddev->private; 1143 conf_t *conf = mddev->private;
1144 int i; 1144 int i;
@@ -1156,7 +1156,7 @@ static void status(struct seq_file *seq, mddev_t *mddev)
1156} 1156}
1157 1157
1158 1158
1159static void error(mddev_t *mddev, struct md_rdev *rdev) 1159static 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 conf_t *conf = mddev->private;
@@ -1233,7 +1233,7 @@ static void close_sync(conf_t *conf)
1233 conf->r1buf_pool = NULL; 1233 conf->r1buf_pool = NULL;
1234} 1234}
1235 1235
1236static int raid1_spare_active(mddev_t *mddev) 1236static int raid1_spare_active(struct mddev *mddev)
1237{ 1237{
1238 int i; 1238 int i;
1239 conf_t *conf = mddev->private; 1239 conf_t *conf = mddev->private;
@@ -1263,7 +1263,7 @@ static int raid1_spare_active(mddev_t *mddev)
1263} 1263}
1264 1264
1265 1265
1266static int raid1_add_disk(mddev_t *mddev, struct md_rdev *rdev) 1266static int raid1_add_disk(struct mddev *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;
@@ -1311,7 +1311,7 @@ static int raid1_add_disk(mddev_t *mddev, struct md_rdev *rdev)
1311 return err; 1311 return err;
1312} 1312}
1313 1313
1314static int raid1_remove_disk(mddev_t *mddev, int number) 1314static int raid1_remove_disk(struct mddev *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;
@@ -1374,7 +1374,7 @@ static void end_sync_write(struct bio *bio, int error)
1374{ 1374{
1375 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); 1375 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
1376 r1bio_t *r1_bio = bio->bi_private; 1376 r1bio_t *r1_bio = bio->bi_private;
1377 mddev_t *mddev = r1_bio->mddev; 1377 struct mddev *mddev = r1_bio->mddev;
1378 conf_t *conf = mddev->private; 1378 conf_t *conf = mddev->private;
1379 int mirror=0; 1379 int mirror=0;
1380 sector_t first_bad; 1380 sector_t first_bad;
@@ -1446,7 +1446,7 @@ static int fix_sync_read_error(r1bio_t *r1_bio)
1446 * made sure that anything with a bad block in range 1446 * made sure that anything with a bad block in range
1447 * will have bi_end_io clear. 1447 * will have bi_end_io clear.
1448 */ 1448 */
1449 mddev_t *mddev = r1_bio->mddev; 1449 struct mddev *mddev = r1_bio->mddev;
1450 conf_t *conf = mddev->private; 1450 conf_t *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;
@@ -1562,7 +1562,7 @@ static int process_checks(r1bio_t *r1_bio)
1562 * If any blocks failed to read, then we need to 1562 * If any blocks failed to read, then we need to
1563 * attempt an over-write 1563 * attempt an over-write
1564 */ 1564 */
1565 mddev_t *mddev = r1_bio->mddev; 1565 struct mddev *mddev = r1_bio->mddev;
1566 conf_t *conf = mddev->private; 1566 conf_t *conf = mddev->private;
1567 int primary; 1567 int primary;
1568 int i; 1568 int i;
@@ -1635,7 +1635,7 @@ static int process_checks(r1bio_t *r1_bio)
1635 return 0; 1635 return 0;
1636} 1636}
1637 1637
1638static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio) 1638static void sync_request_write(struct mddev *mddev, r1bio_t *r1_bio)
1639{ 1639{
1640 conf_t *conf = mddev->private; 1640 conf_t *conf = mddev->private;
1641 int i; 1641 int i;
@@ -1690,7 +1690,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
1690static void fix_read_error(conf_t *conf, int read_disk, 1690static void fix_read_error(conf_t *conf, int read_disk,
1691 sector_t sect, int sectors) 1691 sector_t sect, int sectors)
1692{ 1692{
1693 mddev_t *mddev = conf->mddev; 1693 struct mddev *mddev = conf->mddev;
1694 while(sectors) { 1694 while(sectors) {
1695 int s = sectors; 1695 int s = sectors;
1696 int d = read_disk; 1696 int d = read_disk;
@@ -1792,7 +1792,7 @@ static int submit_bio_wait(int rw, struct bio *bio)
1792 1792
1793static int narrow_write_error(r1bio_t *r1_bio, int i) 1793static int narrow_write_error(r1bio_t *r1_bio, int i)
1794{ 1794{
1795 mddev_t *mddev = r1_bio->mddev; 1795 struct mddev *mddev = r1_bio->mddev;
1796 conf_t *conf = mddev->private; 1796 conf_t *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;
@@ -1922,7 +1922,7 @@ static void handle_read_error(conf_t *conf, r1bio_t *r1_bio)
1922{ 1922{
1923 int disk; 1923 int disk;
1924 int max_sectors; 1924 int max_sectors;
1925 mddev_t *mddev = conf->mddev; 1925 struct mddev *mddev = conf->mddev;
1926 struct bio *bio; 1926 struct bio *bio;
1927 char b[BDEVNAME_SIZE]; 1927 char b[BDEVNAME_SIZE];
1928 struct md_rdev *rdev; 1928 struct md_rdev *rdev;
@@ -2008,7 +2008,7 @@ read_more:
2008 } 2008 }
2009} 2009}
2010 2010
2011static void raid1d(mddev_t *mddev) 2011static void raid1d(struct mddev *mddev)
2012{ 2012{
2013 r1bio_t *r1_bio; 2013 r1bio_t *r1_bio;
2014 unsigned long flags; 2014 unsigned long flags;
@@ -2085,7 +2085,7 @@ static int init_resync(conf_t *conf)
2085 * that can be installed to exclude normal IO requests. 2085 * that can be installed to exclude normal IO requests.
2086 */ 2086 */
2087 2087
2088static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster) 2088static 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 conf_t *conf = mddev->private;
2091 r1bio_t *r1_bio; 2091 r1bio_t *r1_bio;
@@ -2357,7 +2357,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
2357 return nr_sectors; 2357 return nr_sectors;
2358} 2358}
2359 2359
2360static sector_t raid1_size(mddev_t *mddev, sector_t sectors, int raid_disks) 2360static sector_t raid1_size(struct mddev *mddev, sector_t sectors, int raid_disks)
2361{ 2361{
2362 if (sectors) 2362 if (sectors)
2363 return sectors; 2363 return sectors;
@@ -2365,7 +2365,7 @@ static sector_t raid1_size(mddev_t *mddev, sector_t sectors, int raid_disks)
2365 return mddev->dev_sectors; 2365 return mddev->dev_sectors;
2366} 2366}
2367 2367
2368static conf_t *setup_conf(mddev_t *mddev) 2368static conf_t *setup_conf(struct mddev *mddev)
2369{ 2369{
2370 conf_t *conf; 2370 conf_t *conf;
2371 int i; 2371 int i;
@@ -2466,7 +2466,7 @@ static conf_t *setup_conf(mddev_t *mddev)
2466 return ERR_PTR(err); 2466 return ERR_PTR(err);
2467} 2467}
2468 2468
2469static int run(mddev_t *mddev) 2469static int run(struct mddev *mddev)
2470{ 2470{
2471 conf_t *conf; 2471 conf_t *conf;
2472 int i; 2472 int i;
@@ -2546,7 +2546,7 @@ static int run(mddev_t *mddev)
2546 return md_integrity_register(mddev); 2546 return md_integrity_register(mddev);
2547} 2547}
2548 2548
2549static int stop(mddev_t *mddev) 2549static int stop(struct mddev *mddev)
2550{ 2550{
2551 conf_t *conf = mddev->private; 2551 conf_t *conf = mddev->private;
2552 struct bitmap *bitmap = mddev->bitmap; 2552 struct bitmap *bitmap = mddev->bitmap;
@@ -2573,7 +2573,7 @@ static int stop(mddev_t *mddev)
2573 return 0; 2573 return 0;
2574} 2574}
2575 2575
2576static int raid1_resize(mddev_t *mddev, sector_t sectors) 2576static int raid1_resize(struct mddev *mddev, sector_t sectors)
2577{ 2577{
2578 /* no resync is happening, and there is enough space 2578 /* no resync is happening, and there is enough space
2579 * on all devices, so we can resize. 2579 * on all devices, so we can resize.
@@ -2597,7 +2597,7 @@ static int raid1_resize(mddev_t *mddev, sector_t sectors)
2597 return 0; 2597 return 0;
2598} 2598}
2599 2599
2600static int raid1_reshape(mddev_t *mddev) 2600static int raid1_reshape(struct mddev *mddev)
2601{ 2601{
2602 /* We need to: 2602 /* We need to:
2603 * 1/ resize the r1bio_pool 2603 * 1/ resize the r1bio_pool
@@ -2703,7 +2703,7 @@ static int raid1_reshape(mddev_t *mddev)
2703 return 0; 2703 return 0;
2704} 2704}
2705 2705
2706static void raid1_quiesce(mddev_t *mddev, int state) 2706static void raid1_quiesce(struct mddev *mddev, int state)
2707{ 2707{
2708 conf_t *conf = mddev->private; 2708 conf_t *conf = mddev->private;
2709 2709
@@ -2720,7 +2720,7 @@ static void raid1_quiesce(mddev_t *mddev, int state)
2720 } 2720 }
2721} 2721}
2722 2722
2723static void *raid1_takeover(mddev_t *mddev) 2723static void *raid1_takeover(struct mddev *mddev)
2724{ 2724{
2725 /* raid1 can take over: 2725 /* raid1 can take over:
2726 * raid5 with 2 devices, any layout or chunk size 2726 * raid5 with 2 devices, any layout or chunk size