losetup: add --associated option
losetup -j | --associated <file> [-o <num>]
This new option lists all loop devices associated with given file
(and optionally file offset).
Examples:
# losetup -a
/dev/loop0: [0807]:
21921808 (/foo/vfat-mbr.img)
/dev/loop1: [0807]:
21921808 (/foo/vfat-mbr.img), offset 100
/dev/loop2: [0807]:
21921802 (/bar/ext3.img)
# losetup -j /foo/vfat-mbr.img
/dev/loop0: [0807]:
21921808 (/foo/vfat-mbr.img)
/dev/loop1: [0807]:
21921808 (/foo/vfat-mbr.img), offset 100
# losetup -j /foo/vfat-mbr.img -o 100
/dev/loop1: [0807]:
21921808 (/foo/vfat-mbr.img), offset 100
Signed-off-by: Karel Zak <kzak@redhat.com>