From 45f898c05cdb25d0acf8859ecb0feca9dd19f17b Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Sat, 26 Feb 2022 19:41:20 +0100 Subject: [PATCH] disk: remove unused CreateFilesystem method The `CreateFilesystem` method on `PartitionTable` is not used anymore since it got replaced by `CreateVolume`. --- internal/disk/partition_table.go | 35 -------------------------------- 1 file changed, 35 deletions(-) diff --git a/internal/disk/partition_table.go b/internal/disk/partition_table.go index bac29aef5..b6bdd2f0f 100644 --- a/internal/disk/partition_table.go +++ b/internal/disk/partition_table.go @@ -112,41 +112,6 @@ func (pt *PartitionTable) ContainsMountpoint(mountpoint string) bool { return len(entityPath(pt, mountpoint)) > 0 } -// Create a new filesystem within the partition table at the given mountpoint -// with the given minimum size in bytes. -func (pt *PartitionTable) CreateFilesystem(mountpoint string, size uint64) error { - filesystem := Filesystem{ - Type: "xfs", - Mountpoint: mountpoint, - FSTabOptions: "defaults", - FSTabFreq: 0, - FSTabPassNo: 0, - } - - partition := Partition{ - Size: size, - Payload: &filesystem, - } - - n := len(pt.Partitions) - var maxNo int - - if pt.Type == "gpt" { - partition.Type = FilesystemDataGUID - maxNo = 128 - } else { - maxNo = 4 - } - - if n == maxNo { - return fmt.Errorf("maximum number of partitions reached (%d)", maxNo) - } - - pt.Partitions = append(pt.Partitions, partition) - - return nil -} - // Generate all needed UUIDs for all the partiton and filesystems // // Will not overwrite existing UUIDs and only generate UUIDs for