]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev-builtin-blkid: pick up info of backing file
authorLennart Poettering <lennart@poettering.net>
Mon, 6 Mar 2023 10:53:26 +0000 (11:53 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 9 Mar 2023 15:40:55 +0000 (16:40 +0100)
commitbe86e98350528b458dd5ec17bad84bbe2aea3976
treeca2459f140f281a0e064de47d8e91f65aeb039e1
parent85737dd378f4f93432ad6298209333a9baea53f5
udev-builtin-blkid: pick up info of backing file

This adds support for retrieving info about the inode backing a loopback
file to udev-builtin-blkid. It will pick up the inode number and device
of the backing inode, as well as the lo_file_name[] array that the
loopback device maintains.

A later patch uses this information to create block device symlinks in
/dev/ that allow refering block devices by their backing inodes. This is
useful when separate tools set up a loopback device from those which
ultimately shall mount them, and there shall be a stable reference be
passed along. For example, we can add a new kernel option setuploop= or
so which allows setting up a block device via a generator, and still
have a way to safely reference later.

And yes, this doesn't directly have anything to do with the probing
libblkid does, but it's close enough, and we have the device open anyway
here, so the additional ioctl() here should not hurt.
src/udev/udev-builtin-blkid.c