tree-wide: drop references to /dev/loop/by-ref

Follow-up for #28476.
This commit is contained in:
Yu Watanabe 2023-07-21 10:24:17 +09:00
parent d168daa5c2
commit c0d998248e
3 changed files with 2 additions and 27 deletions

15
NEWS
View file

@ -511,21 +511,6 @@ CHANGES WITH 254 in spe:
* udevadm gained the new "verify" verb for validating udev rules files
offline.
* udev will now create symlinks to loopback block devices in the
/dev/loop/by-ref/ directory that are based on the .lo_file_name
string field selected during allocation. The systemd-dissect tool and
the util-linux losetup command now supports a complementing new
switch --loop-ref= for selecting the string. This means a loopback
block device may now be allocated under a caller-chosen reference and
can subsequently be referenced by that without first having to look
up the block device name the caller ended up with.
* udev also creates symlinks to loopback block devices in the
/dev/loop/by-ref/ directory based on the .st_dev/st_ino fields of the
inode attached to the loopback block device. This means that attaching
a file to a loopback device will implicitly make a handle available to
be found via that file's inode information.
* udev gained a new tool "iocost" that can be used to configure QoS IO
cost data based on hwdb information onto suitable block devices. Also
see https://github.com/iocost-benchmark/iocost-benchmarks.

View file

@ -413,13 +413,7 @@
<literal>.lo_file_name</literal> field for the block device. Note this is distinct from the
<filename>/sys/class/block/loopX/loop/backing_file</filename> attribute file that always reports a
path referring to the actual backing file. The latter is subject to mount namespace translation, the
former is not.</para>
<para>This setting is particularly useful in combination with the <option>--attach</option> command,
as it allows later referencing the allocated loop device via <filename>/dev/loop/by-ref/…</filename>
symlinks. Example: first, set up the loopback device via <command>systemd-dissect attach
--loop-ref=quux foo.raw</command>, and then reference it in a command via the specified filename:
<command>cfdisk /dev/loop/by-ref/quux</command>.</para></listitem>
former is not.</para></listitem>
</varlistentry>
<varlistentry>

View file

@ -1156,11 +1156,7 @@ int loop_device_set_filename(LoopDevice *d, const char *name) {
/* Sets the .lo_file_name of the loopback device. This is supposed to contain the path to the file
* backing the block device, but is actually just a free-form string you can pass to the kernel. Most
* tools that actually care for the backing file path use the sysfs attribute file loop/backing_file
* which is a kernel generated string, subject to file system namespaces and such.
*
* .lo_file_name is useful since userspace can select it freely when creating a loopback block
* device, and we can use it for /dev/loop/by-ref/ symlinks, and similar, so that apps can recognize
* their own loopback files. */
* which is a kernel generated string, subject to file system namespaces and such. */
if (name && strlen(name) >= sizeof(info.lo_file_name))
return -ENOBUFS;