Skip to content

Commit

Permalink
disk: add Btrfs to the types implementing VolumeContainer
Browse files Browse the repository at this point in the history
Implement the VolumeContainer interface for Btrfs.  Btrfs doesn't have a
fixed metadata size that needs to be reserved, like the LUKS header.
Similar to the LVM VolumeGroup, there is a lot that can affect the size
of the metadata in a btrfs volume.  However, there is no fixed location
or size that we need to reserve.  More importantly, btrfs subvolumes
don't need to partition the space of a btrfs volume, which means we
don't need to reserve metadata space on the partition to fit metadata
alongside the required size of the sum of subvolumes, like we need to do
for LVM.
  • Loading branch information
achilleas-k authored and supakeen committed Jul 25, 2024
1 parent 87f6a07 commit ad16001
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/disk/btrfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ func (b *Btrfs) GenUUID(rng *rand.Rand) {
}
}

func (b *Btrfs) MetadataSize() uint64 {
return 0
}

type BtrfsSubvolume struct {
Name string
Size uint64
Expand Down

0 comments on commit ad16001

Please sign in to comment.