summaryrefslogtreecommitdiff
path: root/src/import/import-tar.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-06 10:57:17 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-06 11:28:16 +0200
commitd9e2daaf3d8649650cf9784b4fe9d9de4507da0c (patch)
treea6f5960da742e676f249036e59656dac040ecaed /src/import/import-tar.c
parent41d1ed059bbc863c73161f39594de2eb7b338886 (diff)
btrfs: support recursively removing btrfs snapshots
Diffstat (limited to 'src/import/import-tar.c')
-rw-r--r--src/import/import-tar.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/import/import-tar.c b/src/import/import-tar.c
index c5346ca2b0..6ec5504265 100644
--- a/src/import/import-tar.c
+++ b/src/import/import-tar.c
@@ -87,8 +87,7 @@ TarImport* tar_import_unref(TarImport *i) {
}
if (i->temp_path) {
- (void) btrfs_subvol_remove(i->temp_path);
- (void) rm_rf(i->temp_path, REMOVE_ROOT|REMOVE_PHYSICAL);
+ (void) rm_rf(i->temp_path, REMOVE_ROOT|REMOVE_PHYSICAL|REMOVE_SUBVOLUME);
free(i->temp_path);
}
@@ -197,10 +196,8 @@ static int tar_import_finish(TarImport *i) {
return r;
}
- if (i->force_local) {
- (void) btrfs_subvol_remove(i->final_path);
- (void) rm_rf(i->final_path, REMOVE_ROOT|REMOVE_PHYSICAL);
- }
+ if (i->force_local)
+ (void) rm_rf(i->final_path, REMOVE_ROOT|REMOVE_PHYSICAL|REMOVE_SUBVOLUME);
r = rename_noreplace(AT_FDCWD, i->temp_path, AT_FDCWD, i->final_path);
if (r < 0)