diff options
author | Christoph Hellwig <hch@lst.de> | 2024-11-13 09:45:35 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-11-13 19:40:11 +0100 |
commit | 470d2bc3a0bc19a849cc7478c02d3f5ecaa1233e (patch) | |
tree | 6523dd41a70d2d56db768bd7ca7f0eb9e9741d23 /block | |
parent | Merge tag 'nvme-6.13-2024-11-13' of git://git.infradead.org/nvme into for-6.1... (diff) | |
download | linux-470d2bc3a0bc19a849cc7478c02d3f5ecaa1233e.tar.xz linux-470d2bc3a0bc19a849cc7478c02d3f5ecaa1233e.zip |
block: export blk_validate_limits
While block drivers do the validation as part of committing them to the
queue, users that use the limit outside of a block device context have
to validate the limits and fill in the calculated values as well.
So far btrfs is the only user of queue limits without a block device,
and it has gotten away with that more or less by accident. But with
commit 559218d43ec9 ("block: pre-calculate max_zone_append_sectors")
this became fatal for setups that have small max zone append size,
as it won't be limited now.
Export blk_validate_limits so that it can be called directly from btrfs.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20241113084541.34315-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-settings.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c index 7d6b296997c2..f1d4dfdc37a7 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -222,7 +222,7 @@ unsupported: * Check that the limits in lim are valid, initialize defaults for unset * values, and cap values based on others where needed. */ -static int blk_validate_limits(struct queue_limits *lim) +int blk_validate_limits(struct queue_limits *lim) { unsigned int max_hw_sectors; unsigned int logical_block_sectors; @@ -365,6 +365,7 @@ static int blk_validate_limits(struct queue_limits *lim) return err; return blk_validate_zoned_limits(lim); } +EXPORT_SYMBOL_GPL(blk_validate_limits); /* * Set the default limits for a newly allocated queue. @lim contains the |