btrfs: add support for recursive btrfs snapshotting
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user