]> git.ipfire.org Git - thirdparty/util-linux.git/commit
losetup: add --loop-ref and REF column
authorKarel Zak <kzak@redhat.com>
Thu, 16 Mar 2023 12:41:36 +0000 (13:41 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 20 Jul 2023 21:08:53 +0000 (23:08 +0200)
commitdb8f78151c075d25792b6b77b500c1c52a374fe0
treeccfc1bf72601460f6086f56d1e1f8e7f6c197c63
parent54e4a6b145fd6ef943d93e16de748283e687855d
losetup: add --loop-ref and REF column

The lo_file_name is nowhere used (kernel uses backing file descriptor,
no path) and it was used to store limited info about the backing file path
(64 bytes only!). For backward compatibility, we still fill lo_file_name
with the path, but it's nowhere in the userspace used as the complete
backing file path in sysfs.

This commit introduces a new option to overwrite the default path in
lo_file_name. The idea is to use the reference string by udevd in
/dev/loop/by-ref to address loop devices independently on paths.

Addresses: https://github.com/util-linux/util-linux/issues/2106
Suggested-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
include/loopdev.h
lib/loopdev.c
sys-utils/losetup.8.adoc
sys-utils/losetup.c