dm cache: add support for discard passdown to the origin device
authorMike Snitzer <snitzer@redhat.com>
Mon, 25 Feb 2019 16:07:10 +0000 (11:07 -0500)
committerMike Snitzer <snitzer@redhat.com>
Tue, 5 Mar 2019 19:53:52 +0000 (14:53 -0500)
commitde7180ff908b2bc0342e832dbdaa9a5f1ecaa33a
treedb7c3b6e894a7d5f96ab155500ff5a8275cfad66
parentf87e033b3b923d91194348c11221e1bbc92e51b2
dm cache: add support for discard passdown to the origin device

DM cache now defaults to passing discards down to the origin device.
User may disable this using the "no_discard_passdown" feature when
creating the cache device.

If the cache's underlying origin device doesn't support discards then
passdown is disabled (with warning).  Similarly, if the underlying
origin device's max_discard_sectors is less than a cache block discard
passdown will be disabled (this is required because sizing of the cache
internal discard bitset depends on it).

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Documentation/device-mapper/cache.txt
drivers/md/dm-cache-target.c