File: patch

package info (click to toggle)
wiggle 1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 15,036 kB
  • sloc: ansic: 13,649; sh: 1,180; makefile: 194
file content (31 lines) | stat: -rw-r--r-- 949 bytes parent folder | download | duplicates (8)
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);
 }