summaryrefslogtreecommitdiff
path: root/include/linux/device-mapper.h
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2023-03-01 12:48:43 -0500
committerMike Snitzer <snitzer@kernel.org>2023-03-30 15:57:50 -0400
commit06961c487a33a222fd3d84998dc6398ed0449373 (patch)
treece2512c7db900e8f3a92fc1e13502162701ba079 /include/linux/device-mapper.h
parentbb46c56165faf284cf42c197317bff24f899835a (diff)
dm: split discards further if target sets max_discard_granularity
The block core (bio_split_discard) will already split discards based on the 'discard_granularity' and 'max_discard_sectors' queue_limits. But the DM thin target also needs to ensure that it doesn't receive a discard that spans a 'max_discard_sectors' boundary. Introduce a dm_target 'max_discard_granularity' flag that if set will cause DM core to split discard bios relative to 'max_discard_sectors'. This treats 'discard_granularity' as a "min_discard_granularity" and 'max_discard_sectors' as a "max_discard_granularity". Requested-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'include/linux/device-mapper.h')
-rw-r--r--include/linux/device-mapper.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 7975483816e4..8aa6b3ea91fa 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -359,6 +359,12 @@ struct dm_target {
bool discards_supported:1;
/*
+ * Set if this target requires that discards be split on both
+ * 'discard_granularity' and 'max_discard_sectors' boundaries.
+ */
+ bool max_discard_granularity:1;
+
+ /*
* Set if we need to limit the number of in-flight bios when swapping.
*/
bool limit_swap_bios:1;