aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2011-01-13 17:14:33 -0500
committerNeilBrown <neilb@suse.de>2011-01-13 17:14:33 -0500
commitccebd4c4159462c96397ae9af9c667bb394d7b70 (patch)
tree04554f0e7607d906c6b09f31a995fca0dd40c5b5 /drivers/md/md.c
parent57b2caa394393f8870ed41bdcc38a7542593018f (diff)
md-new-param-to_sync_page_io
Add new parameter to 'sync_page_io'. The new parameter allows us to distinguish between metadata and data operations. This becomes important later when we add the ability to use separate devices for data and metadata. Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 0a0d7c2f2ff6..0bc10cc4b961 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -795,7 +795,7 @@ static void bi_complete(struct bio *bio, int error)
795} 795}
796 796
797int sync_page_io(mdk_rdev_t *rdev, sector_t sector, int size, 797int sync_page_io(mdk_rdev_t *rdev, sector_t sector, int size,
798 struct page *page, int rw) 798 struct page *page, int rw, bool metadata_op)
799{ 799{
800 struct bio *bio = bio_alloc_mddev(GFP_NOIO, 1, rdev->mddev); 800 struct bio *bio = bio_alloc_mddev(GFP_NOIO, 1, rdev->mddev);
801 struct completion event; 801 struct completion event;
@@ -804,7 +804,10 @@ int sync_page_io(mdk_rdev_t *rdev, sector_t sector, int size,
804 rw |= REQ_SYNC | REQ_UNPLUG; 804 rw |= REQ_SYNC | REQ_UNPLUG;
805 805
806 bio->bi_bdev = rdev->bdev; 806 bio->bi_bdev = rdev->bdev;
807 bio->bi_sector = sector; 807 if (metadata_op)
808 bio->bi_sector = sector + rdev->sb_start;
809 else
810 bio->bi_sector = sector + rdev->data_offset;
808 bio_add_page(bio, page, size, 0); 811 bio_add_page(bio, page, size, 0);
809 init_completion(&event); 812 init_completion(&event);
810 bio->bi_private = &event; 813 bio->bi_private = &event;
@@ -829,7 +832,7 @@ static int read_disk_sb(mdk_rdev_t * rdev, int size)
829 return 0; 832 return 0;
830 833
831 834
832 if (!sync_page_io(rdev, rdev->sb_start, size, rdev->sb_page, READ)) 835 if (!sync_page_io(rdev, 0, size, rdev->sb_page, READ, true))
833 goto fail; 836 goto fail;
834 rdev->sb_loaded = 1; 837 rdev->sb_loaded = 1;
835 return 0; 838 return 0;