summaryrefslogtreecommitdiff
path: root/src/import/pull-dkr.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-10-23 10:50:53 +0200
committerDaniel Mack <github@zonque.org>2015-10-23 10:50:53 +0200
commit952b4473bc392652b1d4c9dae5ec88fd003c4e1d (patch)
tree8d27afa9b27ceb997013868f2b80a4bb5a993911 /src/import/pull-dkr.c
parentc9fc270e462bf2f4eab963bf71234d64b0c4c30f (diff)
parentb0830e21f47109d8a6ba2fc0afbf9b2ca1ffc2a9 (diff)
Merge pull request #1641 from poettering/btrfs-quota
btrfs quota beef up and various other unrelated changes
Diffstat (limited to 'src/import/pull-dkr.c')
-rw-r--r--src/import/pull-dkr.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/import/pull-dkr.c b/src/import/pull-dkr.c
index 0dab184af1..84211d282b 100644
--- a/src/import/pull-dkr.c
+++ b/src/import/pull-dkr.c
@@ -490,10 +490,16 @@ static int dkr_pull_make_local_copy(DkrPull *i, DkrPullVersion version) {
return r;
if (version == DKR_PULL_V2) {
- char **k = NULL;
+ char **k;
+
STRV_FOREACH(k, i->ancestry) {
- _cleanup_free_ char *d = strjoin(i->image_root, "/.dkr-", *k, NULL);
- r = btrfs_subvol_remove(d, false);
+ _cleanup_free_ char *d;
+
+ d = strjoin(i->image_root, "/.dkr-", *k, NULL);
+ if (!d)
+ return -ENOMEM;
+
+ r = btrfs_subvol_remove(d, BTRFS_REMOVE_QUOTA);
if (r < 0)
return r;
}
@@ -531,12 +537,14 @@ static int dkr_pull_job_on_open_disk(PullJob *j) {
const char *base_path;
base_path = strjoina(i->image_root, "/.dkr-", base);
- r = btrfs_subvol_snapshot(base_path, i->temp_path, BTRFS_SNAPSHOT_FALLBACK_COPY);
+ r = btrfs_subvol_snapshot(base_path, i->temp_path, BTRFS_SNAPSHOT_FALLBACK_COPY|BTRFS_SNAPSHOT_QUOTA);
} else
r = btrfs_subvol_make(i->temp_path);
if (r < 0)
return log_error_errno(r, "Failed to make btrfs subvolume %s: %m", i->temp_path);
+ (void) import_assign_pool_quota_and_warn(i->temp_path);
+
j->disk_fd = import_fork_tar_x(i->temp_path, &i->tar_pid);
if (j->disk_fd < 0)
return j->disk_fd;