Documentation ¶
Overview ¶
Package btrfsvol contains core logical-volume-management layer of btrfs.
Index ¶
- Variables
- type AddrDelta
- type BlockGroupFlags
- type DeviceID
- type IntAddr
- type LogicalAddr
- type LogicalVolume
- func (lv *LogicalVolume[PhysicalVolume]) AddMapping(m Mapping) error
- func (lv *LogicalVolume[PhysicalVolume]) AddPhysicalVolume(id DeviceID, dev PhysicalVolume) error
- func (lv *LogicalVolume[PhysicalVolume]) ClearMappings()
- func (lv *LogicalVolume[PhysicalVolume]) Close() error
- func (lv *LogicalVolume[PhysicalVolume]) CouldAddMapping(m Mapping) bool
- func (lv *LogicalVolume[PhysicalVolume]) Mappings() []Mapping
- func (lv *LogicalVolume[PhysicalVolume]) Name() string
- func (lv *LogicalVolume[PhysicalVolume]) PhysicalVolumes() map[DeviceID]PhysicalVolume
- func (lv *LogicalVolume[PhysicalVolume]) ReadAt(dat []byte, laddr LogicalAddr) (int, error)
- func (lv *LogicalVolume[PhysicalVolume]) Resolve(laddr LogicalAddr) (paddrs containers.Set[QualifiedPhysicalAddr], maxlen AddrDelta)
- func (lv *LogicalVolume[PhysicalVolume]) ResolveAny(laddr LogicalAddr, size AddrDelta) (LogicalAddr, QualifiedPhysicalAddr)
- func (lv *LogicalVolume[PhysicalVolume]) SetName(name string)
- func (lv *LogicalVolume[PhysicalVolume]) Size() LogicalAddr
- func (lv *LogicalVolume[PhysicalVolume]) UnResolve(paddr QualifiedPhysicalAddr) LogicalAddr
- func (lv *LogicalVolume[PhysicalVolume]) WriteAt(dat []byte, laddr LogicalAddr) (int, error)
- type Mapping
- type PhysicalAddr
- type QualifiedPhysicalAddr
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BlockGroupFlags ¶
type BlockGroupFlags uint64
const ( BLOCK_GROUP_DATA BlockGroupFlags = 1 << iota BLOCK_GROUP_SYSTEM BLOCK_GROUP_METADATA BLOCK_GROUP_RAID0 BLOCK_GROUP_RAID1 BLOCK_GROUP_DUP BLOCK_GROUP_RAID10 BLOCK_GROUP_RAID5 BLOCK_GROUP_RAID6 BLOCK_GROUP_RAID1C3 BLOCK_GROUP_RAID1C4 // BLOCK_GROUP_RAID_MASK is the set of bits that mean that // mean the logical:physical relationship is a one:many // relationship rather than a one:one relationship. // // Notably, this does not include BLOCK_GROUP_RAID0. BLOCK_GROUP_RAID_MASK = (BLOCK_GROUP_RAID1 | BLOCK_GROUP_DUP | BLOCK_GROUP_RAID10 | BLOCK_GROUP_RAID5 | BLOCK_GROUP_RAID6 | BLOCK_GROUP_RAID1C3 | BLOCK_GROUP_RAID1C4) )
func (BlockGroupFlags) Has ¶
func (f BlockGroupFlags) Has(req BlockGroupFlags) bool
func (BlockGroupFlags) String ¶
func (f BlockGroupFlags) String() string
type IntAddr ¶
type IntAddr[T _IntAddr[T]] _IntAddr[T]
IntAddr is a type constraint that you can use to accept LogicalAddr or PhysicalAddr.
type LogicalAddr ¶
type LogicalAddr int64
func (LogicalAddr) Add ¶
func (a LogicalAddr) Add(b AddrDelta) LogicalAddr
func (LogicalAddr) Format ¶
func (a LogicalAddr) Format(f fmt.State, verb rune)
func (LogicalAddr) Sub ¶
func (a LogicalAddr) Sub(b LogicalAddr) AddrDelta
type LogicalVolume ¶
type LogicalVolume[PhysicalVolume diskio.File[PhysicalAddr]] struct { // contains filtered or unexported fields }
func (*LogicalVolume[PhysicalVolume]) AddMapping ¶
func (lv *LogicalVolume[PhysicalVolume]) AddMapping(m Mapping) error
func (*LogicalVolume[PhysicalVolume]) AddPhysicalVolume ¶
func (lv *LogicalVolume[PhysicalVolume]) AddPhysicalVolume(id DeviceID, dev PhysicalVolume) error
func (*LogicalVolume[PhysicalVolume]) ClearMappings ¶
func (lv *LogicalVolume[PhysicalVolume]) ClearMappings()
func (*LogicalVolume[PhysicalVolume]) Close ¶
func (lv *LogicalVolume[PhysicalVolume]) Close() error
func (*LogicalVolume[PhysicalVolume]) CouldAddMapping ¶
func (lv *LogicalVolume[PhysicalVolume]) CouldAddMapping(m Mapping) bool
func (*LogicalVolume[PhysicalVolume]) Mappings ¶
func (lv *LogicalVolume[PhysicalVolume]) Mappings() []Mapping
func (*LogicalVolume[PhysicalVolume]) Name ¶
func (lv *LogicalVolume[PhysicalVolume]) Name() string
func (*LogicalVolume[PhysicalVolume]) PhysicalVolumes ¶
func (lv *LogicalVolume[PhysicalVolume]) PhysicalVolumes() map[DeviceID]PhysicalVolume
func (*LogicalVolume[PhysicalVolume]) ReadAt ¶
func (lv *LogicalVolume[PhysicalVolume]) ReadAt(dat []byte, laddr LogicalAddr) (int, error)
func (*LogicalVolume[PhysicalVolume]) Resolve ¶
func (lv *LogicalVolume[PhysicalVolume]) Resolve(laddr LogicalAddr) (paddrs containers.Set[QualifiedPhysicalAddr], maxlen AddrDelta)
func (*LogicalVolume[PhysicalVolume]) ResolveAny ¶
func (lv *LogicalVolume[PhysicalVolume]) ResolveAny(laddr LogicalAddr, size AddrDelta) (LogicalAddr, QualifiedPhysicalAddr)
func (*LogicalVolume[PhysicalVolume]) SetName ¶
func (lv *LogicalVolume[PhysicalVolume]) SetName(name string)
func (*LogicalVolume[PhysicalVolume]) Size ¶
func (lv *LogicalVolume[PhysicalVolume]) Size() LogicalAddr
func (*LogicalVolume[PhysicalVolume]) UnResolve ¶
func (lv *LogicalVolume[PhysicalVolume]) UnResolve(paddr QualifiedPhysicalAddr) LogicalAddr
func (*LogicalVolume[PhysicalVolume]) WriteAt ¶
func (lv *LogicalVolume[PhysicalVolume]) WriteAt(dat []byte, laddr LogicalAddr) (int, error)
type Mapping ¶
type Mapping struct { LAddr LogicalAddr PAddr QualifiedPhysicalAddr Size AddrDelta SizeLocked bool `json:",omitempty"` Flags containers.Optional[BlockGroupFlags] `json:",omitempty"` }
type PhysicalAddr ¶
type PhysicalAddr int64
func (PhysicalAddr) Add ¶
func (a PhysicalAddr) Add(b AddrDelta) PhysicalAddr
func (PhysicalAddr) Format ¶
func (a PhysicalAddr) Format(f fmt.State, verb rune)
func (PhysicalAddr) Sub ¶
func (a PhysicalAddr) Sub(b PhysicalAddr) AddrDelta
type QualifiedPhysicalAddr ¶
type QualifiedPhysicalAddr struct { Dev DeviceID Addr PhysicalAddr }
func (QualifiedPhysicalAddr) Add ¶
func (a QualifiedPhysicalAddr) Add(b AddrDelta) QualifiedPhysicalAddr
func (QualifiedPhysicalAddr) Compare ¶
func (a QualifiedPhysicalAddr) Compare(b QualifiedPhysicalAddr) int
Click to show internal directories.
Click to hide internal directories.