lvmstrap: also test sysfs holders
authorIustin Pop <iustin@google.com>
Wed, 5 Jan 2011 13:19:29 +0000 (14:19 +0100)
committerIustin Pop <iustin@google.com>
Thu, 6 Jan 2011 10:33:56 +0000 (11:33 +0100)
commitb98bb41e2d2fc3a40b4f1c3cc54cfaedbdf973a2
tree67210dcc6103fe81226fc463de4841cf9a399639
parent577d45d4d9e245bafcdceed0ed0023c69d12917a
lvmstrap: also test sysfs holders

If a device has entries in its holder directory
(/sys/block/$name/holders), it means that some kernel system "uses"
that device, and hence should not be considered available.

This patch adds a new 'in-use' check based on this sysfs test, and
introduces an overal InUse function for devices.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
tools/lvmstrap