From: Lennart Poettering Date: Tue, 15 Jul 2025 15:21:03 +0000 (+0200) Subject: discover-image: pick up subvol ctime, too X-Git-Tag: v258-rc1~51^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F38230%2Fhead;p=thirdparty%2Fsystemd.git discover-image: pick up subvol ctime, too The btrfs subvol ctime is conceptually what we call the images "mtime", hence expose it like that, since we get it anyway these days. --- diff --git a/src/shared/btrfs-util.c b/src/shared/btrfs-util.c index 869eb490f8e..349a1691071 100644 --- a/src/shared/btrfs-util.c +++ b/src/shared/btrfs-util.c @@ -323,6 +323,7 @@ int btrfs_subvol_get_info_fd(int fd, uint64_t subvol_id, BtrfsSubvolInfo *ret) { *ret = (BtrfsSubvolInfo) { .subvol_id = info.treeid, .otime = info.otime.sec * USEC_PER_SEC + (info.otime.nsec / NSEC_PER_USEC), + .ctime = info.ctime.sec * USEC_PER_SEC + (info.ctime.nsec / NSEC_PER_USEC), .read_only = FLAGS_SET(info.flags, BTRFS_SUBVOL_RDONLY), }; diff --git a/src/shared/btrfs-util.h b/src/shared/btrfs-util.h index 63fc1d0b32d..d002618bd80 100644 --- a/src/shared/btrfs-util.h +++ b/src/shared/btrfs-util.h @@ -8,7 +8,8 @@ typedef struct BtrfsSubvolInfo { uint64_t subvol_id; - usec_t otime; + usec_t otime; /* creation time */ + usec_t ctime; /* change time */ sd_id128_t uuid; sd_id128_t parent_uuid; diff --git a/src/shared/discover-image.c b/src/shared/discover-image.c index d39c3a13563..58777c683b2 100644 --- a/src/shared/discover-image.c +++ b/src/shared/discover-image.c @@ -430,7 +430,7 @@ static int image_make( filename, info.read_only || read_only, info.otime, - 0, + info.ctime, ret); if (r < 0) return r;