kpartx: handle more than 256 loop devices

Update the loop handling code to support more than 256
devices.

References: bnc#898427

Signed-off-by: Hannes Reinecke <hare@suse.de>
devmapper: do not flush I/O for DM_DEVICE_CREATE

DM_DEVICE_CREATE loads a new table, so there cannot be any
I/O pending. Hence we should be setting the 'no flush'
and 'skip lockfs' flag to avoid delays during creation.

References: bnc#901809

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath: unwrap dev_loss_tmo logic

The dev_loss_tmo logic is convoluted, and the implementation
even more so.
So unwrap the logic to split the temporary dev_loss_tmo
increase into a separate branch. This avoids any overspill
from the temporary dev_loss_tmo setting and makes the code
easier to read.
This partially reverts commit 'Use a default dev_loss_tmo of 600'
as that wasn't the correct fix.

References: bnc#887608

Signed-off-by: Hannes Reinecke <hare@suse.de>