Merge pull request #11243 from poettering/nspawn-root-overlay
add systemd-nspawn --volatile=overlay support, as well as the same for host systems
This commit is contained in:
+8
-5
@@ -743,7 +743,7 @@ int copy_file_fd_full(
|
||||
|
||||
r = copy_bytes_full(fdf, fdt, (uint64_t) -1, copy_flags, NULL, NULL, progress_bytes, userdata);
|
||||
|
||||
(void) copy_times(fdf, fdt);
|
||||
(void) copy_times(fdf, fdt, copy_flags);
|
||||
(void) copy_xattr(fdf, fdt);
|
||||
|
||||
return r;
|
||||
@@ -849,10 +849,9 @@ int copy_file_atomic_full(
|
||||
return 0;
|
||||
}
|
||||
|
||||
int copy_times(int fdf, int fdt) {
|
||||
int copy_times(int fdf, int fdt, CopyFlags flags) {
|
||||
struct timespec ut[2];
|
||||
struct stat st;
|
||||
usec_t crtime = 0;
|
||||
|
||||
assert(fdf >= 0);
|
||||
assert(fdt >= 0);
|
||||
@@ -866,8 +865,12 @@ int copy_times(int fdf, int fdt) {
|
||||
if (futimens(fdt, ut) < 0)
|
||||
return -errno;
|
||||
|
||||
if (fd_getcrtime(fdf, &crtime) >= 0)
|
||||
(void) fd_setcrtime(fdt, crtime);
|
||||
if (FLAGS_SET(flags, COPY_CRTIME)) {
|
||||
usec_t crtime;
|
||||
|
||||
if (fd_getcrtime(fdf, &crtime) >= 0)
|
||||
(void) fd_setcrtime(fdt, crtime);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+2
-1
@@ -14,6 +14,7 @@ typedef enum CopyFlags {
|
||||
COPY_REPLACE = 1 << 2, /* Replace an existing file if there's one */
|
||||
COPY_SAME_MOUNT = 1 << 3, /* Don't descend recursively into other file systems, across mount point boundaries */
|
||||
COPY_MERGE_EMPTY = 1 << 4, /* Merge an existing, empty directory with our new tree to copy */
|
||||
COPY_CRTIME = 1 << 5, /* Generate a user.crtime_usec xattr off the source crtime if there is one, on copying */
|
||||
} CopyFlags;
|
||||
|
||||
typedef int (*copy_progress_bytes_t)(uint64_t n_bytes, void *userdata);
|
||||
@@ -57,5 +58,5 @@ static inline int copy_bytes(int fdf, int fdt, uint64_t max_bytes, CopyFlags cop
|
||||
return copy_bytes_full(fdf, fdt, max_bytes, copy_flags, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
int copy_times(int fdf, int fdt);
|
||||
int copy_times(int fdf, int fdt, CopyFlags flags);
|
||||
int copy_xattr(int fdf, int fdt);
|
||||
|
||||
Reference in New Issue
Block a user