disk: rename VolumeContainer → MountpointCreator

Rename the interface after the one method it has and the attribute
it describes for the implementing entities: being able to create
mountpoints.
This commit is contained in:
Christian Kellner 2022-02-26 19:52:45 +01:00
parent 7bfd0bb49f
commit 17fa96b84a
2 changed files with 4 additions and 4 deletions

View file

@ -96,11 +96,11 @@ type Mountable interface {
GetFSTabOptions() FSTabOptions
}
// A VolumeContainer is a container that is able to create new volumes.
// A MountpointCreator is a container that is able to create new volumes.
//
// CreateMountpoint creates a new mountpoint with the given size and
// returns the entity that represents the new mountpoint.
type VolumeContainer interface {
type MountpointCreator interface {
CreateMountpoint(mountpoint string, size uint64) (Entity, error)
}

View file

@ -316,12 +316,12 @@ func (pt *PartitionTable) createFilesystem(mountpoint string, size uint64) error
panic("no root mountpoint for PartitionTable")
}
var vc VolumeContainer
var vc MountpointCreator
var entity Entity
var idx int
for idx, entity = range rootPath {
var ok bool
if vc, ok = entity.(VolumeContainer); ok {
if vc, ok = entity.(MountpointCreator); ok {
break
}
}