diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/brd.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c index a7463c9595e7..c01b921b1b4a 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c | |||
@@ -486,10 +486,19 @@ static struct brd_device *brd_alloc(int i) | |||
486 | brd->brd_queue = blk_alloc_queue(GFP_KERNEL); | 486 | brd->brd_queue = blk_alloc_queue(GFP_KERNEL); |
487 | if (!brd->brd_queue) | 487 | if (!brd->brd_queue) |
488 | goto out_free_dev; | 488 | goto out_free_dev; |
489 | |||
489 | blk_queue_make_request(brd->brd_queue, brd_make_request); | 490 | blk_queue_make_request(brd->brd_queue, brd_make_request); |
490 | blk_queue_max_hw_sectors(brd->brd_queue, 1024); | 491 | blk_queue_max_hw_sectors(brd->brd_queue, 1024); |
491 | blk_queue_bounce_limit(brd->brd_queue, BLK_BOUNCE_ANY); | 492 | blk_queue_bounce_limit(brd->brd_queue, BLK_BOUNCE_ANY); |
492 | 493 | ||
494 | /* This is so fdisk will align partitions on 4k, because of | ||
495 | * direct_access API needing 4k alignment, returning a PFN | ||
496 | * (This is only a problem on very small devices <= 4M, | ||
497 | * otherwise fdisk will align on 1M. Regardless this call | ||
498 | * is harmless) | ||
499 | */ | ||
500 | blk_queue_physical_block_size(brd->brd_queue, PAGE_SIZE); | ||
501 | |||
493 | brd->brd_queue->limits.discard_granularity = PAGE_SIZE; | 502 | brd->brd_queue->limits.discard_granularity = PAGE_SIZE; |
494 | brd->brd_queue->limits.max_discard_sectors = UINT_MAX; | 503 | brd->brd_queue->limits.max_discard_sectors = UINT_MAX; |
495 | brd->brd_queue->limits.discard_zeroes_data = 1; | 504 | brd->brd_queue->limits.discard_zeroes_data = 1; |