md: change type of first arg to sync_page_io.
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>
This commit is contained in:
Родитель
1c4588e9c1
Коммит
2b193363ef
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче