diff options
| author | Keith Busch <kbusch@kernel.org> | 2026-03-25 12:36:08 -0700 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2026-03-27 22:19:17 +0100 |
| commit | 33eded29319d41fcba5d0257b126a48b449aad47 (patch) | |
| tree | fbe0cb9ebb96782c55c56172636d6a2c2b66a844 /include/linux | |
| parent | cbc1532d2b0ec2a842bd459f01b590bbf16b7443 (diff) | |
dm: provide helper to set stacked limits
There are multiple device mappers that set up their stacking limits
exactly the same for the logical, physical and minimum IO queue limits.
Provide a helper for it.
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/device-mapper.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 38f625af6ab4..cd4faaf5d427 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -755,4 +755,11 @@ static inline unsigned long to_bytes(sector_t n) return (n << SECTOR_SHIFT); } +static inline void dm_stack_bs_limits(struct queue_limits *limits, unsigned int bs) +{ + limits->logical_block_size = max(limits->logical_block_size, bs); + limits->physical_block_size = max(limits->physical_block_size, bs); + limits->io_min = max(limits->io_min, bs); +} + #endif /* _LINUX_DEVICE_MAPPER_H */ |
