-
Committer:
Ben Hutchings
-
Date:
2019-11-05 20:03:26 UTC
-
Revision ID:
git-v1:333ef3af1dcef61a6bc5dba531453e5e0cb27da1
[klibc] losetup: Use LOOP_CTL_GET_FREE to find free device
Since Linux 3.1, the loop driver creates a /dev/loop-control device
node which supports ioctls to allocate and free devices.
When the loop driver is modular, udev creates this in advance, and
opening it causes the driver to be loaded. (The same is not true for
/dev/loop*.)
Using the LOOP_CTL_GET_FREE ioctl also allows creating more than the
default number of loop devices, and is more efficient than checking
a range of possible device names.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>