diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2009-05-22 17:17:50 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-05-22 17:22:54 -0400 |
commit | ae03bf639a5027d27270123f5f6e3ee6a412781d (patch) | |
tree | d705f41a188ad656b1f47f7952626a9f992e3b8f /block/blk-core.c | |
parent | e1defc4ff0cf57aca6c5e3ff99fa503f5943c1f1 (diff) |
block: Use accessor functions for queue limits
Convert all external users of queue limits to using wrapper functions
instead of poking the request queue variables directly.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 59c4af523112..7a4c40184a64 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1437,11 +1437,11 @@ 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 > q->max_hw_sectors)) { | 1440 | if (unlikely(nr_sectors > queue_max_hw_sectors(q))) { |
1441 | printk(KERN_ERR "bio too big device %s (%u > %u)\n", | 1441 | printk(KERN_ERR "bio too big device %s (%u > %u)\n", |
1442 | bdevname(bio->bi_bdev, b), | 1442 | bdevname(bio->bi_bdev, b), |
1443 | bio_sectors(bio), | 1443 | bio_sectors(bio), |
1444 | q->max_hw_sectors); | 1444 | queue_max_hw_sectors(q)); |
1445 | goto end_io; | 1445 | goto end_io; |
1446 | } | 1446 | } |
1447 | 1447 | ||
@@ -1608,8 +1608,8 @@ EXPORT_SYMBOL(submit_bio); | |||
1608 | */ | 1608 | */ |
1609 | int blk_rq_check_limits(struct request_queue *q, struct request *rq) | 1609 | int blk_rq_check_limits(struct request_queue *q, struct request *rq) |
1610 | { | 1610 | { |
1611 | if (blk_rq_sectors(rq) > q->max_sectors || | 1611 | if (blk_rq_sectors(rq) > queue_max_sectors(q) || |
1612 | blk_rq_bytes(rq) > q->max_hw_sectors << 9) { | 1612 | blk_rq_bytes(rq) > queue_max_hw_sectors(q) << 9) { |
1613 | printk(KERN_ERR "%s: over max size limit.\n", __func__); | 1613 | printk(KERN_ERR "%s: over max size limit.\n", __func__); |
1614 | return -EIO; | 1614 | return -EIO; |
1615 | } | 1615 | } |
@@ -1621,8 +1621,8 @@ int blk_rq_check_limits(struct request_queue *q, struct request *rq) | |||
1621 | * limitation. | 1621 | * limitation. |
1622 | */ | 1622 | */ |
1623 | blk_recalc_rq_segments(rq); | 1623 | blk_recalc_rq_segments(rq); |
1624 | if (rq->nr_phys_segments > q->max_phys_segments || | 1624 | if (rq->nr_phys_segments > queue_max_phys_segments(q) || |
1625 | rq->nr_phys_segments > q->max_hw_segments) { | 1625 | rq->nr_phys_segments > queue_max_hw_segments(q)) { |
1626 | printk(KERN_ERR "%s: over max segments limit.\n", __func__); | 1626 | printk(KERN_ERR "%s: over max segments limit.\n", __func__); |
1627 | return -EIO; | 1627 | return -EIO; |
1628 | } | 1628 | } |