disk: introduce ContainsMountpoint helper

Simple wrapper around FindFilesystemForMountpoint that will
return a boolean if a filesystem with the given mountpoint
is defined in the partition table.
This commit is contained in:
Christian Kellner 2021-11-10 14:09:46 +00:00 committed by Tom Gundersen
parent 37d912529c
commit 4f474f1661

View file

@ -223,6 +223,12 @@ func (pt *PartitionTable) FindFilesystemForMountpoint(mountpoint string) *Filesy
return res
}
// 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
}
// Returns the Filesystem instance that corresponds to the root
// filesystem, i.e. the filesystem whose mountpoint is '/'.
func (pt *PartitionTable) RootFilesystem() *Filesystem {