md: Enable discard option for dm-req-crypt based devices

dm-req-crypt based devices are capable of supporting discard option.
DM layer by default does not enable discard option for DM devices.
Since underlying device supports discard option, mapped target should
also allow it.

Change-Id: Ia540a814c3dcd91f573d1f25d637107a48309a58
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
This commit is contained in:
Dinesh K Garg 2015-10-27 14:57:26 -07:00 committed by Kyle Yan
parent 566b0758b6
commit 82b3ab0380

View file

@ -1271,10 +1271,11 @@ static int req_crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
BUG_ON(!req_scatterlist_pool);
/*
* If underlying device supports flush, mapped target should
* also allow it
* If underlying device supports flush/discard, mapped target
* should also allow it
*/
ti->num_flush_bios = 1;
ti->num_discard_bios = 1;
err = 0;
DMINFO("%s: Mapping block_device %s to dm-req-crypt ok!\n",