bcache-tools: only discard cache device during making when discard is enabled

Currently in cache device making time, discard is always issued onto the
cache device. It is unncessary and might be slow if the cache device is
combined by md raid device (e.g. raid10).

Therefore when making a new cache device, this patch only issue discard
when it is explicitly enabled by --discard option.

Signed-off-by: Coly Li <colyli@suse.de>
Cc: Shaoxiong Li <dahefanteng@gmail.com>
1 file changed