Skip to content

Commit 9efa82e

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: remove bdev_stack_limits
This function is just a tiny wrapper around blk_stack_limit and has two callers. Simplify the stack a bit by open coding it in the two callers. Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Tested-by: Damien Le Moal <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 3093a47 commit 9efa82e

File tree

3 files changed

+4
-26
lines changed

3 files changed

+4
-26
lines changed

block/blk-settings.c

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -614,28 +614,6 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
614614
}
615615
EXPORT_SYMBOL(blk_stack_limits);
616616

617-
/**
618-
* bdev_stack_limits - adjust queue limits for stacked drivers
619-
* @t: the stacking driver limits (top device)
620-
* @bdev: the component block_device (bottom)
621-
* @start: first data sector within component device
622-
*
623-
* Description:
624-
* Merges queue limits for a top device and a block_device. Returns
625-
* 0 if alignment didn't change. Returns -1 if adding the bottom
626-
* device caused misalignment.
627-
*/
628-
int bdev_stack_limits(struct queue_limits *t, struct block_device *bdev,
629-
sector_t start)
630-
{
631-
struct request_queue *bq = bdev_get_queue(bdev);
632-
633-
start += get_start_sect(bdev);
634-
635-
return blk_stack_limits(t, &bq->limits, start);
636-
}
637-
EXPORT_SYMBOL(bdev_stack_limits);
638-
639617
/**
640618
* disk_stack_limits - adjust queue limits for stacked drivers
641619
* @disk: MD/DM gendisk (top)
@@ -651,7 +629,8 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
651629
{
652630
struct request_queue *t = disk->queue;
653631

654-
if (bdev_stack_limits(&t->limits, bdev, offset >> 9) < 0) {
632+
if (blk_stack_limits(&t->limits, &bdev_get_queue(bdev)->limits,
633+
get_start_sect(bdev) + (offset >> 9)) < 0) {
655634
char top[BDEVNAME_SIZE], bottom[BDEVNAME_SIZE];
656635

657636
disk_name(disk, 0, top);

drivers/md/dm-table.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@ static int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
458458
return 0;
459459
}
460460

461-
if (bdev_stack_limits(limits, bdev, start) < 0)
461+
if (blk_stack_limits(limits, &q->limits,
462+
get_start_sect(bdev) + start) < 0)
462463
DMWARN("%s: adding target device %s caused an alignment inconsistency: "
463464
"physical_block_size=%u, logical_block_size=%u, "
464465
"alignment_offset=%u, start=%llu",

include/linux/blkdev.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,8 +1139,6 @@ extern void blk_set_default_limits(struct queue_limits *lim);
11391139
extern void blk_set_stacking_limits(struct queue_limits *lim);
11401140
extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
11411141
sector_t offset);
1142-
extern int bdev_stack_limits(struct queue_limits *t, struct block_device *bdev,
1143-
sector_t offset);
11441142
extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
11451143
sector_t offset);
11461144
extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b);

0 commit comments

Comments
 (0)