md: change type of first arg to sync_page_io.
authorNeilBrown <neilb@suse.de>
Wed, 27 Oct 2010 04:16:40 +0000 (15:16 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 28 Oct 2010 06:36:11 +0000 (17:36 +1100)
Currently sync_page_io takes a 'bdev'.
Every caller passes 'rdev->bdev'.
We will soon want another field out of the rdev in sync_page_io,
So just pass the rdev instead of the bdev out of it.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/bitmap.c
drivers/md/md.c
drivers/md/md.h
drivers/md/raid1.c
drivers/md/raid10.c

index 65d5673732131c2a2471b9c952a92e5195b008b3..fdde0279755fdfc9577f171c8654aad7e5599866 100644 (file)
@@ -212,7 +212,7 @@ static struct page *read_sb_page(mddev_t *mddev, loff_t offset,
 
                target = rdev->sb_start + offset + index * (PAGE_SIZE/512);
 
-               if (sync_page_io(rdev->bdev, target,
+               if (sync_page_io(rdev, target,
                                 roundup(size, bdev_logical_block_size(rdev->bdev)),
                                 page, READ)) {
                        page->index = index;
index 0b6fa2a1882acb4eff4f01ebb7cb2b386dc04995..3149bf33f1c51cbc64c48194db0ee2dd4cbde933 100644 (file)
@@ -721,8 +721,8 @@ static void bi_complete(struct bio *bio, int error)
        complete((struct completion*)bio->bi_private);
 }
 
-int sync_page_io(struct block_device *bdev, sector_t sector, int size,
-                  struct page *page, int rw)
+int sync_page_io(mdk_rdev_t *rdev, sector_t sector, int size,
+                struct page *page, int rw)
 {
        struct bio *bio = bio_alloc(GFP_NOIO, 1);
        struct completion event;
@@ -730,7 +730,7 @@ int sync_page_io(struct block_device *bdev, sector_t sector, int size,
 
        rw |= REQ_SYNC | REQ_UNPLUG;
 
-       bio->bi_bdev = bdev;
+       bio->bi_bdev = rdev->bdev;
        bio->bi_sector = sector;
        bio_add_page(bio, page, size, 0);
        init_completion(&event);
@@ -756,7 +756,7 @@ static int read_disk_sb(mdk_rdev_t * rdev, int size)
                return 0;
 
 
-       if (!sync_page_io(rdev->bdev, rdev->sb_start, size, rdev->sb_page, READ))
+       if (!sync_page_io(rdev, rdev->sb_start, size, rdev->sb_page, READ))
                goto fail;
        rdev->sb_loaded = 1;
        return 0;
index 112a2c32db0cb4b613b5c784bff0638f717ad791..5ee5371355535418fd707a93c57e360745f8e7c8 100644 (file)
@@ -495,7 +495,7 @@ extern void md_flush_request(mddev_t *mddev, struct bio *bio);
 extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev,
                           sector_t sector, int size, struct page *page);
 extern void md_super_wait(mddev_t *mddev);
-extern int sync_page_io(struct block_device *bdev, sector_t sector, int size,
+extern int sync_page_io(mdk_rdev_t *rdev, sector_t sector, int size,
                        struct page *page, int rw);
 extern void md_do_sync(mddev_t *mddev);
 extern void md_new_event(mddev_t *mddev);
index 6cb6cae1b386667828e024b307c59676097bc688..08c66afea494cdf50709403461b056b1cd5dac3e 100644 (file)
@@ -1382,7 +1382,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
                                         * active, and resync is currently active
                                         */
                                        rdev = conf->mirrors[d].rdev;
-                                       if (sync_page_io(rdev->bdev,
+                                       if (sync_page_io(rdev,
                                                         sect + rdev->data_offset,
                                                         s<<9,
                                                         bio->bi_io_vec[idx].bv_page,
@@ -1408,7 +1408,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
                                                continue;
                                        rdev = conf->mirrors[d].rdev;
                                        atomic_add(s, &rdev->corrected_errors);
-                                       if (sync_page_io(rdev->bdev,
+                                       if (sync_page_io(rdev,
                                                         sect + rdev->data_offset,
                                                         s<<9,
                                                         bio->bi_io_vec[idx].bv_page,
@@ -1423,7 +1423,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
                                        if (r1_bio->bios[d]->bi_end_io != end_sync_read)
                                                continue;
                                        rdev = conf->mirrors[d].rdev;
-                                       if (sync_page_io(rdev->bdev,
+                                       if (sync_page_io(rdev,
                                                         sect + rdev->data_offset,
                                                         s<<9,
                                                         bio->bi_io_vec[idx].bv_page,
@@ -1507,7 +1507,7 @@ static void fix_read_error(conf_t *conf, int read_disk,
                        rdev = conf->mirrors[d].rdev;
                        if (rdev &&
                            test_bit(In_sync, &rdev->flags) &&
-                           sync_page_io(rdev->bdev,
+                           sync_page_io(rdev,
                                         sect + rdev->data_offset,
                                         s<<9,
                                         conf->tmppage, READ))
@@ -1533,7 +1533,7 @@ static void fix_read_error(conf_t *conf, int read_disk,
                        rdev = conf->mirrors[d].rdev;
                        if (rdev &&
                            test_bit(In_sync, &rdev->flags)) {
-                               if (sync_page_io(rdev->bdev,
+                               if (sync_page_io(rdev,
                                                 sect + rdev->data_offset,
                                                 s<<9, conf->tmppage, WRITE)
                                    == 0)
@@ -1550,7 +1550,7 @@ static void fix_read_error(conf_t *conf, int read_disk,
                        rdev = conf->mirrors[d].rdev;
                        if (rdev &&
                            test_bit(In_sync, &rdev->flags)) {
-                               if (sync_page_io(rdev->bdev,
+                               if (sync_page_io(rdev,
                                                 sect + rdev->data_offset,
                                                 s<<9, conf->tmppage, READ)
                                    == 0)
index 6709cb255200bfd744d14aa399c6a4121bc60575..d54122b9927e8e3752f6a8760bccbecc2d1bb98f 100644 (file)
@@ -1557,7 +1557,7 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
                            test_bit(In_sync, &rdev->flags)) {
                                atomic_inc(&rdev->nr_pending);
                                rcu_read_unlock();
-                               success = sync_page_io(rdev->bdev,
+                               success = sync_page_io(rdev,
                                                       r10_bio->devs[sl].addr +
                                                       sect + rdev->data_offset,
                                                       s<<9,
@@ -1596,7 +1596,7 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
                                atomic_inc(&rdev->nr_pending);
                                rcu_read_unlock();
                                atomic_add(s, &rdev->corrected_errors);
-                               if (sync_page_io(rdev->bdev,
+                               if (sync_page_io(rdev,
                                                 r10_bio->devs[sl].addr +
                                                 sect + rdev->data_offset,
                                                 s<<9, conf->tmppage, WRITE)
@@ -1633,7 +1633,7 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
                                char b[BDEVNAME_SIZE];
                                atomic_inc(&rdev->nr_pending);
                                rcu_read_unlock();
-                               if (sync_page_io(rdev->bdev,
+                               if (sync_page_io(rdev,
                                                 r10_bio->devs[sl].addr +
                                                 sect + rdev->data_offset,
                                                 s<<9, conf->tmppage,