aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_req.c
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2010-11-11 09:19:07 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-03-10 05:19:11 -0500
commit1816a2b47afae838e53a177d5d166cc7be97d6b5 (patch)
tree70d4e3c8aca3ab26af6ebe84ed23b0ba4d4d67e9 /drivers/block/drbd/drbd_req.c
parent3129b1b9aed15bbebde1b2a5719434273feb295d (diff)
drbd: properly use max_hw_sectors to limit the our bio size
To ease tracking of bios in some hash tables, we want it to not cross certain boundaries (128k, used to be 32k). We limit the maximum bio size using queue parameters. Historically some defines and variables we use there have been named max_segment_size, which was misguided. Rename them to max_bio_size, and use [blk_]queue_max_hw_sectors where appropriate. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_req.c')
-rw-r--r--drivers/block/drbd/drbd_req.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index ad3fc6228f27..08f53ce9b88f 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -1047,7 +1047,7 @@ int drbd_make_request_26(struct request_queue *q, struct bio *bio)
1047 1047
1048 /* can this bio be split generically? 1048 /* can this bio be split generically?
1049 * Maybe add our own split-arbitrary-bios function. */ 1049 * Maybe add our own split-arbitrary-bios function. */
1050 if (bio->bi_vcnt != 1 || bio->bi_idx != 0 || bio->bi_size > DRBD_MAX_SEGMENT_SIZE) { 1050 if (bio->bi_vcnt != 1 || bio->bi_idx != 0 || bio->bi_size > DRBD_MAX_BIO_SIZE) {
1051 /* rather error out here than BUG in bio_split */ 1051 /* rather error out here than BUG in bio_split */
1052 dev_err(DEV, "bio would need to, but cannot, be split: " 1052 dev_err(DEV, "bio would need to, but cannot, be split: "
1053 "(vcnt=%u,idx=%u,size=%u,sector=%llu)\n", 1053 "(vcnt=%u,idx=%u,size=%u,sector=%llu)\n",
@@ -1098,7 +1098,7 @@ int drbd_make_request_26(struct request_queue *q, struct bio *bio)
1098} 1098}
1099 1099
1100/* This is called by bio_add_page(). With this function we reduce 1100/* This is called by bio_add_page(). With this function we reduce
1101 * the number of BIOs that span over multiple DRBD_MAX_SEGMENT_SIZEs 1101 * the number of BIOs that span over multiple DRBD_MAX_BIO_SIZEs
1102 * units (was AL_EXTENTs). 1102 * units (was AL_EXTENTs).
1103 * 1103 *
1104 * we do the calculation within the lower 32bit of the byte offsets, 1104 * we do the calculation within the lower 32bit of the byte offsets,
@@ -1118,8 +1118,8 @@ int drbd_merge_bvec(struct request_queue *q, struct bvec_merge_data *bvm, struct
1118 unsigned int bio_size = bvm->bi_size; 1118 unsigned int bio_size = bvm->bi_size;
1119 int limit, backing_limit; 1119 int limit, backing_limit;
1120 1120
1121 limit = DRBD_MAX_SEGMENT_SIZE 1121 limit = DRBD_MAX_BIO_SIZE
1122 - ((bio_offset & (DRBD_MAX_SEGMENT_SIZE-1)) + bio_size); 1122 - ((bio_offset & (DRBD_MAX_BIO_SIZE-1)) + bio_size);
1123 if (limit < 0) 1123 if (limit < 0)
1124 limit = 0; 1124 limit = 0;
1125 if (bio_size == 0) { 1125 if (bio_size == 0) {