return $dev_path;
}
+#
+## Function which returns true if the given mountpoint contains a BTRFS.
+#
+sub is_btrfs($) {
+ my ($mpoint) = @_;
+
+ # Call the volumes status function without any additional arguments
+ # so we only get the mounted volumes, without df details or uuids.
+ my %volumes = &volumes_status();
+
+ # Loop through the hash of volumes.
+ foreach my $volume (sort keys %volumes) {
+ # Skip volume if it is not mounted to the requested mpoint.
+ next unless ($volumes{$volume}{'mpoint'} eq "$mpoint");
+
+ # Return "1" (True) if the requested mountpoint is mounted as BTRFS.
+ return 1 if ($volumes{$volume}{'filesystem'} eq "btrfs");
+ }
+
+ # Return nothing if the mointpoint is not mounted as BTRFS.
+ return;
+}
1;