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:
parent
37d912529c
commit
4f474f1661
1 changed files with 6 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue