return;
}
+#
+## Easy to use function to delete a snapshot by it's ID.
+##
+## Requires the numeric ID of the snapshot.
+## Optional a volume can be specified if it differs from the default one.
+#
+sub btrfs_remove_snapshot ($$) {
+ my ($id, $volume) = @_;
+
+ # Assign default value if no volume has been given.
+ $volume //="/";
+
+ # Call the btrfs binary to delete the requested snapshot.
+ my $ret = &General::system("$btrfs_bin", "subvolume", "delete", "-c", "-i", "$id", "$volume");
+
+ # Return the error code if there was one.
+ return $ret if ($ret);
+
+ # Return nothing on success.
+ return;
+}
+
#
## Private function to filter the output of btrfs_subvolume_list command.
##