aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_main.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_main.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_main.c')
-rw-r--r--drivers/block/drbd/drbd_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 451fc36a85cb..9d9c2ed31e9a 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -1924,7 +1924,7 @@ int drbd_send_sizes(struct drbd_conf *mdev, int trigger_reply, enum dds_flags fl
1924 p.d_size = cpu_to_be64(d_size); 1924 p.d_size = cpu_to_be64(d_size);
1925 p.u_size = cpu_to_be64(u_size); 1925 p.u_size = cpu_to_be64(u_size);
1926 p.c_size = cpu_to_be64(trigger_reply ? 0 : drbd_get_capacity(mdev->this_bdev)); 1926 p.c_size = cpu_to_be64(trigger_reply ? 0 : drbd_get_capacity(mdev->this_bdev));
1927 p.max_segment_size = cpu_to_be32(queue_max_segment_size(mdev->rq_queue)); 1927 p.max_bio_size = cpu_to_be32(queue_max_hw_sectors(mdev->rq_queue) << 9);
1928 p.queue_order_type = cpu_to_be16(q_order_type); 1928 p.queue_order_type = cpu_to_be16(q_order_type);
1929 p.dds_flags = cpu_to_be16(flags); 1929 p.dds_flags = cpu_to_be16(flags);
1930 1930
@@ -2952,7 +2952,7 @@ static void drbd_destroy_mempools(void)
2952static int drbd_create_mempools(void) 2952static int drbd_create_mempools(void)
2953{ 2953{
2954 struct page *page; 2954 struct page *page;
2955 const int number = (DRBD_MAX_SEGMENT_SIZE/PAGE_SIZE) * minor_count; 2955 const int number = (DRBD_MAX_BIO_SIZE/PAGE_SIZE) * minor_count;
2956 int i; 2956 int i;
2957 2957
2958 /* prepare our caches and mempools */ 2958 /* prepare our caches and mempools */
@@ -3218,7 +3218,7 @@ struct drbd_conf *drbd_new_device(unsigned int minor)
3218 q->backing_dev_info.congested_data = mdev; 3218 q->backing_dev_info.congested_data = mdev;
3219 3219
3220 blk_queue_make_request(q, drbd_make_request_26); 3220 blk_queue_make_request(q, drbd_make_request_26);
3221 blk_queue_max_segment_size(q, DRBD_MAX_SEGMENT_SIZE); 3221 blk_queue_max_hw_sectors(q, DRBD_MAX_BIO_SIZE >> 9);
3222 blk_queue_bounce_limit(q, BLK_BOUNCE_ANY); 3222 blk_queue_bounce_limit(q, BLK_BOUNCE_ANY);
3223 blk_queue_merge_bvec(q, drbd_merge_bvec); 3223 blk_queue_merge_bvec(q, drbd_merge_bvec);
3224 q->queue_lock = &mdev->req_lock; 3224 q->queue_lock = &mdev->req_lock;