diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2010-01-11 03:21:49 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2010-01-11 08:29:20 -0500 |
commit | 17be8c245054b9c7786545af3ba3ca4e54cd4ad9 (patch) | |
tree | 563687812bbb1b08643dfcc25997e34eb22a71b5 /block | |
parent | dd3d145d49c5816b79acc6761ebbd842bc50b0ee (diff) |
block: bdev_stack_limits wrapper
DM does not want to know about partition offsets. Add a partition-aware
wrapper that DM can use when stacking block devices.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Reviewed-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-settings.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c index 127f82551855..5eeb9e0d256e 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c | |||
@@ -640,6 +640,28 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, | |||
640 | EXPORT_SYMBOL(blk_stack_limits); | 640 | EXPORT_SYMBOL(blk_stack_limits); |
641 | 641 | ||
642 | /** | 642 | /** |
643 | * bdev_stack_limits - adjust queue limits for stacked drivers | ||
644 | * @t: the stacking driver limits (top device) | ||
645 | * @bdev: the component block_device (bottom) | ||
646 | * @start: first data sector within component device | ||
647 | * | ||
648 | * Description: | ||
649 | * Merges queue limits for a top device and a block_device. Returns | ||
650 | * 0 if alignment didn't change. Returns -1 if adding the bottom | ||
651 | * device caused misalignment. | ||
652 | */ | ||
653 | int bdev_stack_limits(struct queue_limits *t, struct block_device *bdev, | ||
654 | sector_t start) | ||
655 | { | ||
656 | struct request_queue *bq = bdev_get_queue(bdev); | ||
657 | |||
658 | start += get_start_sect(bdev); | ||
659 | |||
660 | return blk_stack_limits(t, &bq->limits, start << 9); | ||
661 | } | ||
662 | EXPORT_SYMBOL(bdev_stack_limits); | ||
663 | |||
664 | /** | ||
643 | * disk_stack_limits - adjust queue limits for stacked drivers | 665 | * disk_stack_limits - adjust queue limits for stacked drivers |
644 | * @disk: MD/DM gendisk (top) | 666 | * @disk: MD/DM gendisk (top) |
645 | * @bdev: the underlying block device (bottom) | 667 | * @bdev: the underlying block device (bottom) |