From 10f9c75519671e7c7ab8993b54fe22da7c2d0c38 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 25 Dec 2014 03:19:19 +0100 Subject: machined: beef up machined image listing with creation/modification times of subvolumes We make use of the btrfs subvol crtime for this, and for gpt images of a manually managed xattr, if we can. --- src/import/import-dkr.c | 2 +- src/import/import-gpt.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/import') diff --git a/src/import/import-dkr.c b/src/import/import-dkr.c index 8f26191c40..b290619305 100644 --- a/src/import/import-dkr.c +++ b/src/import/import-dkr.c @@ -780,7 +780,7 @@ static void dkr_import_curl_on_finished(CurlGlue *g, CURL *curl, CURLcode result goto fail; } - r = btrfs_subvol_read_only(job->temp_path, true); + r = btrfs_subvol_set_read_only(job->temp_path, true); if (r < 0) { log_error_errno(r, "Failed to mark snapshot read-only: %m"); goto fail; diff --git a/src/import/import-gpt.c b/src/import/import-gpt.c index 503f1e64cf..a81efa2bba 100644 --- a/src/import/import-gpt.c +++ b/src/import/import-gpt.c @@ -171,6 +171,8 @@ static void gpt_import_curl_on_finished(CurlGlue *g, CURL *curl, CURLcode result ut[1] = ut[0]; (void) futimens(f->disk_fd, ut); + + fd_setcrtime(f->disk_fd, f->mtime); } if (fstat(f->disk_fd, &st) < 0) { -- cgit v1.2.3-54-g00ecf