Versions in this module Expand all Collapse all v0 v0.1.0 Jul 11, 2023 Changes in this version + func ListNodes(ctx context.Context, fs *btrfs.FS) ([]btrfsvol.LogicalAddr, error) + func Open(ctx context.Context, flag int, filenames ...string) (*btrfs.FS, error) + func ScanDevices(ctx context.Context, fs *btrfs.FS, ...) (map[btrfsvol.DeviceID]Result, error) + func ScanOneDevice(ctx context.Context, dev *btrfs.Device, ...) (Result, error) + func WalkAllTrees(ctx context.Context, fs btrfs.ReadableFS, cbs WalkAllTreesHandler) + type DeviceScanner interface + ScanDone func(ctx context.Context) (Result, error) + ScanNode func(ctx context.Context, addr btrfsvol.PhysicalAddr, node *btrfstree.Node) error + ScanSector func(ctx context.Context, dev *btrfs.Device, paddr btrfsvol.PhysicalAddr) error + ScanStats func() Stats + type DeviceScannerFactory func(ctx context.Context, sb btrfstree.Superblock, numBytes btrfsvol.PhysicalAddr, ...) DeviceScanner[Stats, Result] + type Graph struct + BadNodes map[btrfsvol.LogicalAddr]error + EdgesFrom map[btrfsvol.LogicalAddr][]*GraphEdge + EdgesTo map[btrfsvol.LogicalAddr][]*GraphEdge + Nodes map[btrfsvol.LogicalAddr]GraphNode + func NewGraph(ctx context.Context, sb btrfstree.Superblock) Graph + func ReadGraph(_ctx context.Context, fs *btrfs.FS, nodeList []btrfsvol.LogicalAddr) (Graph, error) + func (g Graph) FinalCheck(ctx context.Context, fs btrfstree.NodeSource) error + func (g Graph) InsertNode(node *btrfstree.Node) + type GraphEdge struct + FromNode btrfsvol.LogicalAddr + FromRoot btrfsvol.LogicalAddr + FromSlot int + FromTree btrfsprim.ObjID + ToGeneration btrfsprim.Generation + ToKey btrfsprim.Key + ToLevel uint8 + ToNode btrfsvol.LogicalAddr + func (kp GraphEdge) String() string + type GraphNode struct + Addr btrfsvol.LogicalAddr + Generation btrfsprim.Generation + Items []KeyAndSize + Level uint8 + Owner btrfsprim.ObjID + func (n GraphNode) CheckExpectations(g Graph, exp btrfstree.NodeExpectations) error + func (n GraphNode) MaxItem(g Graph) btrfsprim.Key + func (n GraphNode) MinItem(g Graph) btrfsprim.Key + func (n GraphNode) NumItems(g Graph) int + func (n GraphNode) String() string + type ItemPtr struct + Node btrfsvol.LogicalAddr + Slot int + func (ptr ItemPtr) String() string + type KeyAndSize struct + Key btrfsprim.Key + Size uint32 + type RebuiltForrest struct + func NewRebuiltForrest(fs btrfs.ReadableFS, graph Graph, cb RebuiltForrestCallbacks, ...) *RebuiltForrest + func (ts *RebuiltForrest) AcquireNode(ctx context.Context, addr btrfsvol.LogicalAddr, exp btrfstree.NodeExpectations) (*btrfstree.Node, error) + func (ts *RebuiltForrest) ForrestLookup(ctx context.Context, treeID btrfsprim.ObjID) (btrfstree.Tree, error) + func (ts *RebuiltForrest) Name() string + func (ts *RebuiltForrest) ReadAt(p []byte, off btrfsvol.LogicalAddr) (int, error) + func (ts *RebuiltForrest) RebuiltAddRoots(ctx context.Context, ...) + func (ts *RebuiltForrest) RebuiltListRoots(ctx context.Context) map[btrfsprim.ObjID]containers.Set[btrfsvol.LogicalAddr] + func (ts *RebuiltForrest) RebuiltTree(ctx context.Context, treeID btrfsprim.ObjID) (*RebuiltTree, error) + func (ts *RebuiltForrest) ReleaseNode(node *btrfstree.Node) + func (ts *RebuiltForrest) Superblock() (*btrfstree.Superblock, error) + type RebuiltForrestCallbacks interface + AddedRoot func(ctx context.Context, tree btrfsprim.ObjID, root btrfsvol.LogicalAddr) + LookupRoot func(ctx context.Context, tree btrfsprim.ObjID) (offset btrfsprim.Generation, item btrfsitem.Root, err error) + LookupUUID func(ctx context.Context, uuid btrfsprim.UUID) (id btrfsprim.ObjID, err error) + type RebuiltForrestExtendedCallbacks interface + AddedItem func(ctx context.Context, tree btrfsprim.ObjID, key btrfsprim.Key) + type RebuiltTree struct + ID btrfsprim.ObjID + Parent *RebuiltTree + ParentGen btrfsprim.Generation + Root btrfsvol.LogicalAddr + Roots containers.Set[btrfsvol.LogicalAddr] + UUID btrfsprim.UUID + func (tree *RebuiltTree) RebuiltAcquireItems(ctx context.Context) *containers.SortedMap[btrfsprim.Key, ItemPtr] + func (tree *RebuiltTree) RebuiltAcquirePotentialItems(ctx context.Context) *containers.SortedMap[btrfsprim.Key, ItemPtr] + func (tree *RebuiltTree) RebuiltAddRoot(ctx context.Context, rootNode btrfsvol.LogicalAddr) + func (tree *RebuiltTree) RebuiltCOWDistance(parentID btrfsprim.ObjID) (dist int, ok bool) + func (tree *RebuiltTree) RebuiltLeafToRoots(ctx context.Context, leaf btrfsvol.LogicalAddr) containers.Set[btrfsvol.LogicalAddr] + func (tree *RebuiltTree) RebuiltReleaseItems() + func (tree *RebuiltTree) RebuiltReleasePotentialItems() + func (tree *RebuiltTree) RebuiltShouldReplace(oldNode, newNode btrfsvol.LogicalAddr) bool + func (tree *RebuiltTree) TreeLookup(ctx context.Context, key btrfsprim.Key) (btrfstree.Item, error) + func (tree *RebuiltTree) TreeParentID(_ context.Context) (btrfsprim.ObjID, btrfsprim.Generation, error) + func (tree *RebuiltTree) TreeRange(ctx context.Context, handleFn func(btrfstree.Item) bool) error + func (tree *RebuiltTree) TreeSearch(ctx context.Context, searcher btrfstree.TreeSearcher) (btrfstree.Item, error) + func (tree *RebuiltTree) TreeSubrange(ctx context.Context, min int, searcher btrfstree.TreeSearcher, ...) error + func (tree *RebuiltTree) TreeWalk(ctx context.Context, cbs btrfstree.TreeWalkHandler) + type WalkAllTreesHandler struct + BadTree func(name string, id btrfsprim.ObjID, err error) + PostTree func(name string, id btrfsprim.ObjID) + PreTree func(name string, id btrfsprim.ObjID) + Tree btrfstree.TreeWalkHandler