Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260348
b: refs/heads/master
c: 029bcbd
h: refs/heads/master
v: v3
  • Loading branch information
Josh Durgin authored and Sage Weil committed Jul 26, 2011
1 parent 8b81d5f commit 05ecb16
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e9852227431a0ed6ceda064f33e4218757acab6c
refs/heads/master: 029bcbd8b076fd19787b8c73e58dd0a6f2c0caf1
15 changes: 15 additions & 0 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,14 @@ static int rbd_get_num_segments(struct rbd_image_header *header,
return end_seg - start_seg + 1;
}

/*
* returns the size of an object in the image
*/
static u64 rbd_obj_bytes(struct rbd_image_header *header)
{
return 1 << header->obj_order;
}

/*
* bio helpers
*/
Expand Down Expand Up @@ -1765,6 +1773,13 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
q = blk_init_queue(rbd_rq_fn, &rbd_dev->lock);
if (!q)
goto out_disk;

/* set io sizes to object size */
blk_queue_max_hw_sectors(q, rbd_obj_bytes(&rbd_dev->header) / 512ULL);
blk_queue_max_segment_size(q, rbd_obj_bytes(&rbd_dev->header));
blk_queue_io_min(q, rbd_obj_bytes(&rbd_dev->header));
blk_queue_io_opt(q, rbd_obj_bytes(&rbd_dev->header));

blk_queue_merge_bvec(q, rbd_merge_bvec);
disk->queue = q;

Expand Down

0 comments on commit 05ecb16

Please sign in to comment.