btrfs: add support for recursive btrfs snapshotting

This commit is contained in:
Lennart Poettering
2015-04-06 15:26:59 +02:00
parent cbf21ecc02
commit f70a17f8d4
6 changed files with 193 additions and 72 deletions
+8
View File
@@ -133,9 +133,17 @@ int main(int argc, char *argv[]) {
if (mkdir("/xxxrectest/mnt", 0755) < 0)
log_error_errno(errno, "Failed to make directory: %m");
r = btrfs_subvol_snapshot("/xxxrectest", "/xxxrectest2", BTRFS_SNAPSHOT_RECURSIVE);
if (r < 0)
log_error_errno(r, "Failed to snapshot subvolume: %m");
r = btrfs_subvol_remove("/xxxrectest", true);
if (r < 0)
log_error_errno(r, "Failed to recursively remove subvolume: %m");
r = btrfs_subvol_remove("/xxxrectest2", true);
if (r < 0)
log_error_errno(r, "Failed to recursively remove subvolume: %m");
return 0;
}