Versions in this module Expand all Collapse all v0 v0.1.0 Jul 11, 2023 Changes in this version + const MaxLevel + var ErrNoItem = errNotExist("item") + var ErrNoTree = errNotExist("tree") + var ErrNotANode = errors.New("does not look like a node") + func CheckOwner(ctx context.Context, forrest Forrest, treeID btrfsprim.ObjID, ...) error + type BackrefRev uint8 + const MixedBackrefRev + const OldBackrefRev + type Forrest interface + ForrestLookup func(ctx context.Context, treeID btrfsprim.ObjID) (Tree, error) + type IOError struct + Err error + func (e *IOError) Error() string + func (e *IOError) Unwrap() error + type IncompatFlags uint64 + const FeatureIncompatBigMetadata + const FeatureIncompatCompressLZO + const FeatureIncompatCompressZSTD + const FeatureIncompatDefaultSubvol + const FeatureIncompatExtendedIRef + const FeatureIncompatExtentTreeV2 + const FeatureIncompatMetadataUUID + const FeatureIncompatMixedBackref + const FeatureIncompatMixedGroups + const FeatureIncompatNoHoles + const FeatureIncompatRAID1C34 + const FeatureIncompatRAID56 + const FeatureIncompatSkinnyMetadata + const FeatureIncompatZoned + func (f IncompatFlags) Has(req IncompatFlags) bool + func (f IncompatFlags) String() string + type Item struct + Body btrfsitem.Item + BodySize uint32 + Key btrfsprim.Key + type ItemHeader struct + DataOffset uint32 + DataSize uint32 + Key btrfsprim.Key + type KeyPointer struct + BlockPtr btrfsvol.LogicalAddr + Generation btrfsprim.Generation + Key btrfsprim.Key + type Node struct + BodyInterior []KeyPointer + BodyLeaf []Item + ChecksumType btrfssum.CSumType + Head NodeHeader + Padding []byte + Size uint32 + func ReadNode(fs diskio.ReaderAt[Addr], sb Superblock, addr Addr) (*Node, error) + func (node *Node) LeafFreeSpace() uint32 + func (node *Node) RawFree() + func (node *Node) UnmarshalBinary(nodeBuf []byte) (int, error) + func (node Node) CalculateChecksum() (btrfssum.CSum, error) + func (node Node) MarshalBinary() ([]byte, error) + func (node Node) MaxItem() (btrfsprim.Key, bool) + func (node Node) MaxItems() uint32 + func (node Node) MinItem() (btrfsprim.Key, bool) + func (node Node) ValidateChecksum() error + type NodeError struct + Err error + NodeAddr Addr + Op string + func (e *NodeError[Addr]) Error() string + func (e *NodeError[Addr]) Unwrap() error + type NodeExpectations struct + Generation containers.Optional[btrfsprim.Generation] + LAddr containers.Optional[btrfsvol.LogicalAddr] + Level containers.Optional[uint8] + MaxItem containers.Optional[btrfsprim.Key] + MinItem containers.Optional[btrfsprim.Key] + Owner func(btrfsprim.ObjID, btrfsprim.Generation) error + func (exp NodeExpectations) Check(node *Node) error + type NodeFlags uint64 + const NodeReloc + const NodeWritten + func (NodeFlags) BinaryStaticSize() int + func (f *NodeFlags) UnmarshalBinary(dat []byte) (int, error) + func (f NodeFlags) Has(req NodeFlags) bool + func (f NodeFlags) MarshalBinary() ([]byte, error) + func (f NodeFlags) String() string + type NodeHeader struct + Addr btrfsvol.LogicalAddr + BackrefRev BackrefRev + Checksum btrfssum.CSum + ChunkTreeUUID btrfsprim.UUID + Flags NodeFlags + Generation btrfsprim.Generation + Level uint8 + MetadataUUID btrfsprim.UUID + NumItems uint32 + Owner btrfsprim.ObjID + type NodeSource interface + AcquireNode func(ctx context.Context, addr btrfsvol.LogicalAddr, exp NodeExpectations) (*Node, error) + ReleaseNode func(*Node) + Superblock func() (*Superblock, error) + type Path []PathElem + func (path Path) NodeExpectations(ctx context.Context) (_ btrfsvol.LogicalAddr, _ NodeExpectations, ok bool) + func (path Path) Parent() Path + func (path Path) String() string + type PathElem interface + type PathItem struct + FromSlot int + FromTree btrfsprim.ObjID + ToKey btrfsprim.Key + type PathKP struct + FromSlot int + FromTree btrfsprim.ObjID + ToAddr btrfsvol.LogicalAddr + ToGeneration btrfsprim.Generation + ToLevel uint8 + ToMaxKey btrfsprim.Key + ToMinKey btrfsprim.Key + type PathRoot struct + Forrest Forrest + ToAddr btrfsvol.LogicalAddr + ToGeneration btrfsprim.Generation + ToLevel uint8 + TreeID btrfsprim.ObjID + type RawForrest struct + NodeSource NodeSource + func (forrest RawForrest) ForrestLookup(ctx context.Context, treeID btrfsprim.ObjID) (Tree, error) + func (forrest RawForrest) RawTree(ctx context.Context, treeID btrfsprim.ObjID) (*RawTree, error) + type RawTree struct + Forrest RawForrest + func (tree *RawTree) TreeLookup(ctx context.Context, key btrfsprim.Key) (Item, error) + func (tree *RawTree) TreeParentID(ctx context.Context) (btrfsprim.ObjID, btrfsprim.Generation, error) + func (tree *RawTree) TreeRange(ctx context.Context, handleFn func(Item) bool) error + func (tree *RawTree) TreeSearch(ctx context.Context, searcher TreeSearcher) (Item, error) + func (tree *RawTree) TreeSubrange(ctx context.Context, min int, searcher TreeSearcher, handleFn func(Item) bool) error + func (tree *RawTree) TreeWalk(ctx context.Context, cbs TreeWalkHandler) + type RootBackup struct + BytesUsed uint64 + ChecksumRoot btrfsprim.ObjID + ChecksumRootGen btrfsprim.Generation + ChecksumRootLevel uint8 + ChunkRoot btrfsprim.ObjID + ChunkRootGen btrfsprim.Generation + ChunkRootLevel uint8 + DevRoot btrfsprim.ObjID + DevRootGen btrfsprim.Generation + DevRootLevel uint8 + ExtentRoot btrfsprim.ObjID + ExtentRootGen btrfsprim.Generation + ExtentRootLevel uint8 + FSRoot btrfsprim.ObjID + FSRootGen btrfsprim.Generation + FSRootLevel uint8 + NumDevices uint64 + Padding [10]byte + TotalBytes uint64 + TreeRoot btrfsprim.ObjID + TreeRootGen btrfsprim.Generation + TreeRootLevel uint8 + Unused [8 * 4]byte + type Search struct + ItemType btrfsprim.ItemType + ItemTypeMatching SearchItemType + ObjectID btrfsprim.ObjID + OffsetHigh uint64 + OffsetLow uint64 + OffsetMatching SearchOffset + OffsetName string + func SearchExactKey(k btrfsprim.Key) Search + func SearchObject(objID btrfsprim.ObjID) Search + func SearchRootItem(treeID btrfsprim.ObjID) Search + func (a Search) Compare(b Search) int + func (o Search) Search(k btrfsprim.Key, _ uint32) int + func (o Search) String() string + type SearchItemType int8 + const ItemTypeAny + const ItemTypeExact + type SearchOffset int8 + const OffsetAny + const OffsetExact + const OffsetName + const OffsetRange + type Superblock struct + BlockGroupRoot btrfsvol.LogicalAddr + BlockGroupRootGeneration btrfsprim.Generation + BlockGroupRootLevel uint8 + BytesUsed uint64 + CacheGeneration btrfsprim.Generation + Checksum btrfssum.CSum + ChecksumType btrfssum.CSumType + ChunkLevel uint8 + ChunkRootGeneration btrfsprim.Generation + ChunkTree btrfsvol.LogicalAddr + CompatFlags uint64 + CompatROFlags uint64 + DevItem btrfsitem.Dev + FSUUID btrfsprim.UUID + Flags uint64 + Generation btrfsprim.Generation + IncompatFlags IncompatFlags + Label [0x100]byte + LeafSize uint32 + LogLevel uint8 + LogRootTransID uint64 + LogTree btrfsvol.LogicalAddr + Magic [8]byte + MetadataUUID btrfsprim.UUID + NodeSize uint32 + NumDevices uint64 + NumGlobalRoots uint64 + Padding [565]byte + Reserved [199]byte + RootDirObjectID btrfsprim.ObjID + RootLevel uint8 + RootTree btrfsvol.LogicalAddr + SectorSize uint32 + Self btrfsvol.PhysicalAddr + StripeSize uint32 + SuperRoots [4]RootBackup + SysChunkArray [0x800]byte + SysChunkArraySize uint32 + TotalBytes uint64 + UUIDTreeGeneration btrfsprim.Generation + func (a Superblock) Equal(b Superblock) bool + func (sb Superblock) CalculateChecksum() (btrfssum.CSum, error) + func (sb Superblock) EffectiveMetadataUUID() btrfsprim.UUID + func (sb Superblock) ParseSysChunkArray() ([]SysChunk, error) + func (sb Superblock) ValidateChecksum() error + type SysChunk struct + Chunk btrfsitem.Chunk + Key btrfsprim.Key + func (sc *SysChunk) UnmarshalBinary(dat []byte) (int, error) + func (sc SysChunk) MarshalBinary() ([]byte, error) + type Tree interface + TreeLookup func(ctx context.Context, key btrfsprim.Key) (Item, error) + TreeParentID func(ctx context.Context) (btrfsprim.ObjID, btrfsprim.Generation, error) + TreeRange func(ctx context.Context, handleFn func(Item) bool) error + TreeSearch func(ctx context.Context, search TreeSearcher) (Item, error) + TreeSubrange func(ctx context.Context, min int, search TreeSearcher, handleFn func(Item) bool) error + TreeWalk func(ctx context.Context, cbs TreeWalkHandler) + type TreeRoot struct + Generation btrfsprim.Generation + ID btrfsprim.ObjID + Level uint8 + ParentGen btrfsprim.Generation + ParentUUID btrfsprim.UUID + RootInode btrfsprim.ObjID + RootNode btrfsvol.LogicalAddr + func LookupTreeRoot(ctx context.Context, forrest Forrest, sb Superblock, treeID btrfsprim.ObjID) (*TreeRoot, error) + type TreeSearcher interface + Search func(key btrfsprim.Key, size uint32) int + func SearchCSum(laddr btrfsvol.LogicalAddr, algSize int) TreeSearcher + type TreeWalkHandler struct + BadItem func(Path, Item) + BadNode func(Path, *Node, error) bool + BadSuperblock func(error) + Item func(Path, Item) + KeyPointer func(Path, KeyPointer) bool + Node func(Path, *Node)