kpartx: find_loop_by_file: use sysfs
authorMartin Wilck <mwilck@suse.com>
Mon, 15 May 2017 15:37:21 +0000 (17:37 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 17 May 2017 21:45:21 +0000 (23:45 +0200)
commit6ff376d43cadf934447e1ae8a907d73ba874ad92
tree45b0e7b9952c92f9e65e0c8da127c7a2dcb8e5bc
parent9bdfa3eb8e24b668e6c2bb882cddb0ccfe23ed5b
kpartx: find_loop_by_file: use sysfs

Rather then searching through all of /dev, look up loop devices
in /sys/devices/virtual/block. This is cleaner and more robust
(/dev/loop$Xp$Y symlinks may confuse kpartx).

Signed-off-by: Martin Wilck <mwilck@suse.com>
kpartx/lopart.c