summaryrefslogtreecommitdiffstats
path: root/src/shared/discover-image.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-02-26 17:39:55 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-03-02 05:11:37 +0100
commit674b04ff1b6deab17f5d36c036c0275ba94e1ebc (patch)
treeded872db0bffeccb8fe5171019d9d265164874cc /src/shared/discover-image.c
parenttest-signal-util: add test for signal_is_blocked() (diff)
downloadsystemd-674b04ff1b6deab17f5d36c036c0275ba94e1ebc.tar.xz
systemd-674b04ff1b6deab17f5d36c036c0275ba94e1ebc.zip
btrfs-util: add helper that abstracts "might be btrfs subvol?" check
Let#s not hardcode inode nr 256 everywhere, but abstract this check slightly.
Diffstat (limited to 'src/shared/discover-image.c')
-rw-r--r--src/shared/discover-image.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/shared/discover-image.c b/src/shared/discover-image.c
index fb59d1d704..79c4c70a41 100644
--- a/src/shared/discover-image.c
+++ b/src/shared/discover-image.c
@@ -260,8 +260,7 @@ static int image_make(
if (fd < 0)
return -errno;
- /* btrfs subvolumes have inode 256 */
- if (st->st_ino == 256) {
+ if (btrfs_might_be_subvol(st)) {
r = btrfs_is_filesystem(fd);
if (r < 0)