disk: honour the fact that some containers have metadata
Re-introduce the VolumeContainer interface but with a different meaning: it is supposed to be implemented by all container that contain volumes and as a result have themselves a size, like eg LVM2, LUKS2 and PartitionTable (the latter is not yet included). The sole method on the interface for now is MetadataSize, which should return the metadata for the container itself. Use that new `VolumeContainer.MetadataSize` method when we up- date the sizes of elements in `resizeEntitybranch`.
This commit is contained in:
parent
17fa96b84a
commit
ed4e0a94a4
4 changed files with 33 additions and 0 deletions
|
|
@ -74,3 +74,12 @@ func (lc *LUKSContainer) GenUUID(rng *rand.Rand) {
|
|||
lc.UUID = uuid.Must(newRandomUUIDFromReader(rng)).String()
|
||||
}
|
||||
}
|
||||
|
||||
func (lc *LUKSContainer) MetadataSize() uint64 {
|
||||
if lc == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
// 16 MiB is the default size for the LUKS2 header
|
||||
return 16 * 1024 * 1024
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue