rebuildtrees

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2023 License: Apache-2.0, GPL-2.0, GPL-3.0-or-later, + 1 more Imports: 20 Imported by: 0

Documentation

Overview

Package rebuildtrees is the guts of the `btrfs-rec inspect rebuild-trees` command, which rebuilds broken trees, but requires already-functioning chunk/dev-extent/blockgroup trees. chunk/dev-extent/blockgroup trees.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtentDataRefPtr

type ExtentDataRefPtr struct {
	btrfsutil.ItemPtr
	RefNum int // Only for EXTENT_ITEM and METADATA_ITEM
}

ExtentDataRefPtr is a pointer to a *btrfsitem.ExtentDataRef, whether it be to an EXTENT_DATA_REF item proper, or to an inline ref inside of another EXTENT_ITEM or METADATA_ITEM.

type FlagsAndErr

type FlagsAndErr struct {
	NoDataSum bool
	Err       error
}

type Rebuilder

type Rebuilder interface {
	Rebuild(context.Context) error
	ListRoots(context.Context) map[btrfsprim.ObjID]containers.Set[btrfsvol.LogicalAddr]
}

func NewRebuilder

func NewRebuilder(ctx context.Context, fs *btrfs.FS, nodeList []btrfsvol.LogicalAddr) (Rebuilder, error)

type ScanDevicesResult

type ScanDevicesResult struct {
	Graph btrfsutil.Graph

	Flags        map[btrfsutil.ItemPtr]FlagsAndErr       // INODE_ITEM
	Names        map[btrfsutil.ItemPtr][]byte            // DIR_INDEX
	Sizes        map[btrfsutil.ItemPtr]SizeAndErr        // EXTENT_CSUM and EXTENT_DATA
	DataBackrefs map[btrfsutil.ItemPtr][]btrfsprim.ObjID // EXTENT_DATA_REF, EXTENT_ITEM, and METADATA_ITEM
}

func ScanDevices

func ScanDevices(_ctx context.Context, fs *btrfs.FS, nodeList []btrfsvol.LogicalAddr) (ScanDevicesResult, error)

type SizeAndErr

type SizeAndErr struct {
	Size uint64
	Err  error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL