disk: use entityPath in ContainsMountpoint

Implement `PartitionTable.ContainsMountpoint` via `entityPath` instead
of `FindFileSystemForMountpoint`; `entityPath` is the more generic
variant of `FindFileSystemForMountpoint` and will work with anything
that implements `Mountable`.

Co-Authored-By: Achilleas Koutsou <achilleas@koutsou.net>
This commit is contained in:
Christian Kellner 2022-02-19 10:35:21 +01:00 committed by Tom Gundersen
parent bd5b673a99
commit 908b62ae08

View file

@ -187,7 +187,7 @@ func (pt *PartitionTable) FindFilesystemForMountpoint(mountpoint string) *Filesy
// Returns if the partition table contains a filesystem with the given
// mount point.
func (pt *PartitionTable) ContainsMountpoint(mountpoint string) bool {
return pt.FindFilesystemForMountpoint(mountpoint) != nil
return len(entityPath(pt, mountpoint)) > 0
}
// Returns the Filesystem instance that corresponds to the root