Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333263
b: refs/heads/master
c: 02f3939
h: refs/heads/master
i:
  333261: 631c534
  333259: ae01aef
  333255: d610329
  333247: 385c10f
v: v3
  • Loading branch information
Shaohua Li authored and Jens Axboe committed Sep 28, 2012
1 parent 0aab92a commit 31e3473
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 232f1b51062553b7cf49f99719fbd1b8a8d80f29
refs/heads/master: 02f3939e1a9357b7c370a4a69717cf9c02452737
26 changes: 14 additions & 12 deletions trunk/fs/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,7 @@ struct bio_pair *bio_split(struct bio *bi, int first_sectors)
trace_block_split(bdev_get_queue(bi->bi_bdev), bi,
bi->bi_sector + first_sectors);

BUG_ON(bi->bi_vcnt != 1);
BUG_ON(bi->bi_vcnt != 1 && bi->bi_vcnt != 0);
BUG_ON(bi->bi_idx != 0);
atomic_set(&bp->cnt, 3);
bp->error = 0;
Expand All @@ -1485,20 +1485,22 @@ struct bio_pair *bio_split(struct bio *bi, int first_sectors)
bp->bio2.bi_size -= first_sectors << 9;
bp->bio1.bi_size = first_sectors << 9;

bp->bv1 = bi->bi_io_vec[0];
bp->bv2 = bi->bi_io_vec[0];
if (bi->bi_vcnt != 0) {
bp->bv1 = bi->bi_io_vec[0];
bp->bv2 = bi->bi_io_vec[0];

if (bio_is_rw(bi)) {
bp->bv2.bv_offset += first_sectors << 9;
bp->bv2.bv_len -= first_sectors << 9;
bp->bv1.bv_len = first_sectors << 9;
}
if (bio_is_rw(bi)) {
bp->bv2.bv_offset += first_sectors << 9;
bp->bv2.bv_len -= first_sectors << 9;
bp->bv1.bv_len = first_sectors << 9;
}

bp->bio1.bi_io_vec = &bp->bv1;
bp->bio2.bi_io_vec = &bp->bv2;
bp->bio1.bi_io_vec = &bp->bv1;
bp->bio2.bi_io_vec = &bp->bv2;

bp->bio1.bi_max_vecs = 1;
bp->bio2.bi_max_vecs = 1;
bp->bio1.bi_max_vecs = 1;
bp->bio2.bi_max_vecs = 1;
}

bp->bio1.bi_end_io = bio_pair_end_1;
bp->bio2.bi_end_io = bio_pair_end_2;
Expand Down

0 comments on commit 31e3473

Please sign in to comment.