diff options
author | Karel Zak <kzak@redhat.com> | 2013-08-06 11:04:35 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2013-08-06 11:04:35 +0200 |
commit | 3cb2413b02ff01f535b82eb630bd4f157ed7b1c8 (patch) | |
tree | 36e3c1b83da117dce3be08eac039a1d0e2387a00 /include | |
parent | 777519226d033fdea9bcad043c01aa6539c8b71d (diff) | |
download | util-linux-3cb2413b02ff01f535b82eb630bd4f157ed7b1c8.tar.gz |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/loopdev.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/loopdev.h b/include/loopdev.h index 9f199a08..eb328a08 100644 --- a/include/loopdev.h +++ b/include/loopdev.h @@ -149,6 +149,7 @@ extern void loopcxt_enable_debug(struct loopdev_cxt *lc, int enable); extern int loopcxt_set_device(struct loopdev_cxt *lc, const char *device) __attribute__ ((warn_unused_result)); extern int loopcxt_has_device(struct loopdev_cxt *lc); +extern int loopcxt_add_device(struct loopdev_cxt *lc); extern char *loopcxt_strdup_device(struct loopdev_cxt *lc); extern const char *loopcxt_get_device(struct loopdev_cxt *lc); extern struct sysfs_cxt *loopcxt_get_sysfs(struct loopdev_cxt *lc); |