]> git.ipfire.org Git - thirdparty/util-linux.git/commit
losetup: use loop-control to explicitly ask for device
authorKarel Zak <kzak@redhat.com>
Tue, 6 Aug 2013 09:04:35 +0000 (11:04 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 6 Aug 2013 09:04:35 +0000 (11:04 +0200)
commit3cb2413b02ff01f535b82eb630bd4f157ed7b1c8
tree36e3c1b83da117dce3be08eac039a1d0e2387a00
parent777519226d033fdea9bcad043c01aa6539c8b71d
losetup: use loop-control to explicitly ask for device

Now we use LOOP_CTL_GET_FREE ioctl to ask for free device, for example

  losetup -f foo.img

Unfortunately, losetup(8) allows to ask for specified device

  losetup /dev/loop100 foo.img

and in this case we assume that the device already exists in the
system. This is incorrect, we should be able to use loop-control
LOOP_CTL_ADD ioctl to ask for the specified device.

Signed-off-by: Karel Zak <kzak@redhat.com>
include/loopdev.h
lib/loopdev.c
sys-utils/losetup.c