1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
@@ -1,15 +1,20 @@@
-static struct buffer_head *raid5_build_block (struct stripe_head *sh, int i)
+static void raid5_build_block (struct stripe_head *sh, int i)
{
raid5_conf_t *conf = sh->raid_conf;
- struct buffer_head *bh = sh->bh_cache[i];
- unsigned long block = sh->sector / (sh->size >> 9);
+ struct r5dev *dev = &sh->dev[i];
- init_buffer(bh, raid5_end_read_request, sh);
- bh->b_dev = conf->disks[i].dev;
- /* FIXME - later we will need bdev here */
- bh->b_blocknr = block;
+ bio_init(&dev->req);
+ dev->req.bi_io_vec = &dev->vec;
+ dev->req.bi_vcnt++;
+ dev->vec.bv_page = dev->page;
+ dev->vec.bv_len = STRIPE_SIZE;
+ dev->vec.bv_offset = 0;
- bh->b_state = (1 << BH_Req) | (1 << BH_Mapped);
- bh->b_size = sh->size;
- return bh;
+ dev->req.bi_bdev = conf->disks[i].bdev;
+ dev->req.bi_sector = sh->sector;
+ dev->req.bi_private = sh;
+
+ dev->flags = 0;
+ if (i != sh->pd_idx)
+ dev->sector = compute_blocknr(sh, i);
}
|