]> git.ipfire.org Git - thirdparty/systemd.git/commit
blockdev-util: add new helper blockdev_get_device_size()
authorLennart Poettering <lennart@poettering.net>
Mon, 4 Dec 2023 16:58:33 +0000 (17:58 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 13 Dec 2023 16:35:22 +0000 (17:35 +0100)
commit01db9c85cf928de2ab4cfa07acbe35d0f574de44
treea378980fa7a31520359e1f9f7cb93ff074fef4ce
parentf9ba9d3eb7c350f31132ccd9ed1ee3c0c693f5c5
blockdev-util: add new helper blockdev_get_device_size()

This function is just a wrapper around the BLKGETSIZE64. Which is a
pretty simple ioctl. The only reason to wrap it, is that the headers we
need to call it are a bit messy (as "linux/fs.h" is incompatible with
certain glibc headers). Hence add the simple helper that wraps it and
allows us to do the header mess needed in one file only.

It's also nicely symmetric to blockdev_get_sector_size().
src/home/homework-luks.c
src/partition/growfs.c
src/partition/repart.c
src/shared/blockdev-util.c
src/shared/blockdev-util.h
src/shared/discover-image.c
src/shared/dissect-image.c