dm bufio: implement discard
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 7 Feb 2020 20:59:25 +0000 (15:59 -0500)
committerMike Snitzer <snitzer@redhat.com>
Fri, 15 May 2020 14:29:35 +0000 (10:29 -0400)
commit6fbeb0048e6b93f7b7f195864f3ddc876ac4d42e
treed4e81956f5c878632bdd583caa7bc0c3244c3b37
parentd3c7b35c20d60650bac8b55c17b194adda03a979
dm bufio: implement discard

Add functions dm_bufio_issue_discard and dm_bufio_discard_buffers.
dm_bufio_issue_discard sends discard request to the underlying device.
dm_bufio_discard_buffers frees buffers in the range and then calls
dm_bufio_issue_discard.

Also, factor out block_to_sector for reuse in dm_bufio_issue_discard.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-bufio.c
include/linux/dm-bufio.h