aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 8135228e4b29..ac0fa10f8fa5 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
36EXPORT_TRACEPOINT_SYMBOL_GPL(block_remap); 36EXPORT_TRACEPOINT_SYMBOL_GPL(block_remap);
37EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_remap);
37EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_complete); 38EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_complete);
38 39
39static int __make_request(struct request_queue *q, struct bio *bio); 40static int __make_request(struct request_queue *q, struct bio *bio);
@@ -1029,7 +1030,7 @@ static void part_round_stats_single(int cpu, struct hd_struct *part,
1029 if (now == part->stamp) 1030 if (now == part->stamp)
1030 return; 1031 return;
1031 1032
1032 if (part->in_flight) { 1033 if (part_in_flight(part)) {
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(part) * (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));
@@ -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 }