diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-10-16 06:29:29 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-10-16 06:29:29 -0400 |
commit | a39d113936370ba524fa9e34d6954c3625c8aa64 (patch) | |
tree | 6e4334d4fe9018a6032a2cf47f144e1716ca30ad /drivers/block | |
parent | 8b6800fbced0c6745a9b8f5f72f15ef8bce8a6be (diff) | |
parent | 7e3da6c4b9a69f44b758b2c88190ac33ac4ea1a1 (diff) |
Merge branch 'barrier' into for-linus
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/pktcdvd.c | 7 | ||||
-rw-r--r-- | drivers/block/ps3disk.c | 21 |
2 files changed, 7 insertions, 21 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 540bf3676985..a8130a4ad6d4 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -1133,16 +1133,21 @@ static void pkt_gather_data(struct pktcdvd_device *pd, struct packet_data *pkt) | |||
1133 | * Schedule reads for missing parts of the packet. | 1133 | * Schedule reads for missing parts of the packet. |
1134 | */ | 1134 | */ |
1135 | for (f = 0; f < pkt->frames; f++) { | 1135 | for (f = 0; f < pkt->frames; f++) { |
1136 | struct bio_vec *vec; | ||
1137 | |||
1136 | int p, offset; | 1138 | int p, offset; |
1137 | if (written[f]) | 1139 | if (written[f]) |
1138 | continue; | 1140 | continue; |
1139 | bio = pkt->r_bios[f]; | 1141 | bio = pkt->r_bios[f]; |
1142 | vec = bio->bi_io_vec; | ||
1140 | bio_init(bio); | 1143 | bio_init(bio); |
1141 | bio->bi_max_vecs = 1; | 1144 | bio->bi_max_vecs = 1; |
1142 | bio->bi_sector = pkt->sector + f * (CD_FRAMESIZE >> 9); | 1145 | bio->bi_sector = pkt->sector + f * (CD_FRAMESIZE >> 9); |
1143 | bio->bi_bdev = pd->bdev; | 1146 | bio->bi_bdev = pd->bdev; |
1144 | bio->bi_end_io = pkt_end_io_read; | 1147 | bio->bi_end_io = pkt_end_io_read; |
1145 | bio->bi_private = pkt; | 1148 | bio->bi_private = pkt; |
1149 | bio->bi_io_vec = vec; | ||
1150 | bio->bi_destructor = pkt_bio_destructor; | ||
1146 | 1151 | ||
1147 | p = (f * CD_FRAMESIZE) / PAGE_SIZE; | 1152 | p = (f * CD_FRAMESIZE) / PAGE_SIZE; |
1148 | offset = (f * CD_FRAMESIZE) % PAGE_SIZE; | 1153 | offset = (f * CD_FRAMESIZE) % PAGE_SIZE; |
@@ -1439,6 +1444,8 @@ static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt) | |||
1439 | pkt->w_bio->bi_bdev = pd->bdev; | 1444 | pkt->w_bio->bi_bdev = pd->bdev; |
1440 | pkt->w_bio->bi_end_io = pkt_end_io_packet_write; | 1445 | pkt->w_bio->bi_end_io = pkt_end_io_packet_write; |
1441 | pkt->w_bio->bi_private = pkt; | 1446 | pkt->w_bio->bi_private = pkt; |
1447 | pkt->w_bio->bi_io_vec = bvec; | ||
1448 | pkt->w_bio->bi_destructor = pkt_bio_destructor; | ||
1442 | for (f = 0; f < pkt->frames; f++) | 1449 | for (f = 0; f < pkt->frames; f++) |
1443 | if (!bio_add_page(pkt->w_bio, bvec[f].bv_page, CD_FRAMESIZE, bvec[f].bv_offset)) | 1450 | if (!bio_add_page(pkt->w_bio, bvec[f].bv_page, CD_FRAMESIZE, bvec[f].bv_offset)) |
1444 | BUG(); | 1451 | BUG(); |
diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index 06d0552cf49c..e354bfc070e1 100644 --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c | |||
@@ -414,26 +414,6 @@ static void ps3disk_prepare_flush(struct request_queue *q, struct request *req) | |||
414 | req->cmd_type = REQ_TYPE_FLUSH; | 414 | req->cmd_type = REQ_TYPE_FLUSH; |
415 | } | 415 | } |
416 | 416 | ||
417 | static int ps3disk_issue_flush(struct request_queue *q, struct gendisk *gendisk, | ||
418 | sector_t *sector) | ||
419 | { | ||
420 | struct ps3_storage_device *dev = q->queuedata; | ||
421 | struct request *req; | ||
422 | int res; | ||
423 | |||
424 | dev_dbg(&dev->sbd.core, "%s:%u\n", __func__, __LINE__); | ||
425 | |||
426 | req = blk_get_request(q, WRITE, __GFP_WAIT); | ||
427 | ps3disk_prepare_flush(q, req); | ||
428 | res = blk_execute_rq(q, gendisk, req, 0); | ||
429 | if (res) | ||
430 | dev_err(&dev->sbd.core, "%s:%u: flush request failed %d\n", | ||
431 | __func__, __LINE__, res); | ||
432 | blk_put_request(req); | ||
433 | return res; | ||
434 | } | ||
435 | |||
436 | |||
437 | static unsigned long ps3disk_mask; | 417 | static unsigned long ps3disk_mask; |
438 | 418 | ||
439 | static DEFINE_MUTEX(ps3disk_mask_mutex); | 419 | static DEFINE_MUTEX(ps3disk_mask_mutex); |
@@ -506,7 +486,6 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev) | |||
506 | blk_queue_dma_alignment(queue, dev->blk_size-1); | 486 | blk_queue_dma_alignment(queue, dev->blk_size-1); |
507 | blk_queue_hardsect_size(queue, dev->blk_size); | 487 | blk_queue_hardsect_size(queue, dev->blk_size); |
508 | 488 | ||
509 | blk_queue_issue_flush_fn(queue, ps3disk_issue_flush); | ||
510 | blk_queue_ordered(queue, QUEUE_ORDERED_DRAIN_FLUSH, | 489 | blk_queue_ordered(queue, QUEUE_ORDERED_DRAIN_FLUSH, |
511 | ps3disk_prepare_flush); | 490 | ps3disk_prepare_flush); |
512 | 491 | ||