diff options
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 8135228e4b29..81f34311659a 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include "blk.h" | 34 | #include "blk.h" |
35 | 35 | ||
36 | EXPORT_TRACEPOINT_SYMBOL_GPL(block_remap); | 36 | EXPORT_TRACEPOINT_SYMBOL_GPL(block_remap); |
37 | EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_remap); | ||
37 | EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_complete); | 38 | EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_complete); |
38 | 39 | ||
39 | static int __make_request(struct request_queue *q, struct bio *bio); | 40 | static int __make_request(struct request_queue *q, struct bio *bio); |
@@ -69,7 +70,7 @@ static void drive_stat_acct(struct request *rq, int new_io) | |||
69 | part_stat_inc(cpu, part, merges[rw]); | 70 | part_stat_inc(cpu, part, merges[rw]); |
70 | else { | 71 | else { |
71 | part_round_stats(cpu, part); | 72 | part_round_stats(cpu, part); |
72 | part_inc_in_flight(part, rw); | 73 | part_inc_in_flight(part); |
73 | } | 74 | } |
74 | 75 | ||
75 | part_stat_unlock(); | 76 | part_stat_unlock(); |
@@ -1031,7 +1032,7 @@ static void part_round_stats_single(int cpu, struct hd_struct *part, | |||
1031 | 1032 | ||
1032 | if (part->in_flight) { | 1033 | if (part->in_flight) { |
1033 | __part_stat_add(cpu, part, time_in_queue, | 1034 | __part_stat_add(cpu, part, time_in_queue, |
1034 | part_in_flight(part) * (now - part->stamp)); | 1035 | part->in_flight * (now - part->stamp)); |
1035 | __part_stat_add(cpu, part, io_ticks, (now - part->stamp)); | 1036 | __part_stat_add(cpu, part, io_ticks, (now - part->stamp)); |
1036 | } | 1037 | } |
1037 | part->stamp = now; | 1038 | part->stamp = now; |
@@ -1124,7 +1125,6 @@ void init_request_from_bio(struct request *req, struct bio *bio) | |||
1124 | req->cmd_flags |= REQ_DISCARD; | 1125 | req->cmd_flags |= REQ_DISCARD; |
1125 | if (bio_rw_flagged(bio, BIO_RW_BARRIER)) | 1126 | if (bio_rw_flagged(bio, BIO_RW_BARRIER)) |
1126 | req->cmd_flags |= REQ_SOFTBARRIER; | 1127 | req->cmd_flags |= REQ_SOFTBARRIER; |
1127 | req->q->prepare_discard_fn(req->q, req); | ||
1128 | } else if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) | 1128 | } else if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) |
1129 | req->cmd_flags |= REQ_HARDBARRIER; | 1129 | req->cmd_flags |= REQ_HARDBARRIER; |
1130 | 1130 | ||
@@ -1437,7 +1437,8 @@ static inline void __generic_make_request(struct bio *bio) | |||
1437 | goto end_io; | 1437 | goto end_io; |
1438 | } | 1438 | } |
1439 | 1439 | ||
1440 | if (unlikely(nr_sectors > queue_max_hw_sectors(q))) { | 1440 | if (unlikely(!bio_rw_flagged(bio, BIO_RW_DISCARD) && |
1441 | nr_sectors > queue_max_hw_sectors(q))) { | ||
1441 | printk(KERN_ERR "bio too big device %s (%u > %u)\n", | 1442 | printk(KERN_ERR "bio too big device %s (%u > %u)\n", |
1442 | bdevname(bio->bi_bdev, b), | 1443 | bdevname(bio->bi_bdev, b), |
1443 | bio_sectors(bio), | 1444 | bio_sectors(bio), |
@@ -1470,7 +1471,7 @@ static inline void __generic_make_request(struct bio *bio) | |||
1470 | goto end_io; | 1471 | goto end_io; |
1471 | 1472 | ||
1472 | if (bio_rw_flagged(bio, BIO_RW_DISCARD) && | 1473 | if (bio_rw_flagged(bio, BIO_RW_DISCARD) && |
1473 | !q->prepare_discard_fn) { | 1474 | !blk_queue_discard(q)) { |
1474 | err = -EOPNOTSUPP; | 1475 | err = -EOPNOTSUPP; |
1475 | goto end_io; | 1476 | goto end_io; |
1476 | } | 1477 | } |
@@ -1738,7 +1739,7 @@ static void blk_account_io_done(struct request *req) | |||
1738 | part_stat_inc(cpu, part, ios[rw]); | 1739 | part_stat_inc(cpu, part, ios[rw]); |
1739 | part_stat_add(cpu, part, ticks[rw], duration); | 1740 | part_stat_add(cpu, part, ticks[rw], duration); |
1740 | part_round_stats(cpu, part); | 1741 | part_round_stats(cpu, part); |
1741 | part_dec_in_flight(part, rw); | 1742 | part_dec_in_flight(part); |
1742 | 1743 | ||
1743 | part_stat_unlock(); | 1744 | part_stat_unlock(); |
1744 | } | 1745 | } |
@@ -2491,6 +2492,14 @@ int kblockd_schedule_work(struct request_queue *q, struct work_struct *work) | |||
2491 | } | 2492 | } |
2492 | EXPORT_SYMBOL(kblockd_schedule_work); | 2493 | EXPORT_SYMBOL(kblockd_schedule_work); |
2493 | 2494 | ||
2495 | int kblockd_schedule_delayed_work(struct request_queue *q, | ||
2496 | struct delayed_work *work, | ||
2497 | unsigned long delay) | ||
2498 | { | ||
2499 | return queue_delayed_work(kblockd_workqueue, work, delay); | ||
2500 | } | ||
2501 | EXPORT_SYMBOL(kblockd_schedule_delayed_work); | ||
2502 | |||
2494 | int __init blk_dev_init(void) | 2503 | int __init blk_dev_init(void) |
2495 | { | 2504 | { |
2496 | BUILD_BUG_ON(__REQ_NR_BITS > 8 * | 2505 | BUILD_BUG_ON(__REQ_NR_BITS > 8 * |