aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/rbd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 7392d7af7eab..15f65b5f3fc7 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -630,6 +630,14 @@ static int rbd_get_num_segments(struct rbd_image_header *header,
630} 630}
631 631
632/* 632/*
633 * returns the size of an object in the image
634 */
635static u64 rbd_obj_bytes(struct rbd_image_header *header)
636{
637 return 1 << header->obj_order;
638}
639
640/*
633 * bio helpers 641 * bio helpers
634 */ 642 */
635 643
@@ -1765,6 +1773,13 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
1765 q = blk_init_queue(rbd_rq_fn, &rbd_dev->lock); 1773 q = blk_init_queue(rbd_rq_fn, &rbd_dev->lock);
1766 if (!q) 1774 if (!q)
1767 goto out_disk; 1775 goto out_disk;
1776
1777 /* set io sizes to object size */
1778 blk_queue_max_hw_sectors(q, rbd_obj_bytes(&rbd_dev->header) / 512ULL);
1779 blk_queue_max_segment_size(q, rbd_obj_bytes(&rbd_dev->header));
1780 blk_queue_io_min(q, rbd_obj_bytes(&rbd_dev->header));
1781 blk_queue_io_opt(q, rbd_obj_bytes(&rbd_dev->header));
1782
1768 blk_queue_merge_bvec(q, rbd_merge_bvec); 1783 blk_queue_merge_bvec(q, rbd_merge_bvec);
1769 disk->queue = q; 1784 disk->queue = q;
1770 1785