rebuildmappings

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: 23 Imported by: 0

Documentation

Overview

Package rebuildmappings is the guts of the `btrfs-rec inspect rebuild-mappings` command, which rebuilds broken chunk/dev-extent/blockgroup trees.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RebuildMappings

func RebuildMappings(ctx context.Context, fs *btrfs.FS, scanResults ScanDevicesResult) error

Types

type FoundBlockGroup

type FoundBlockGroup struct {
	Key btrfsprim.Key
	BG  btrfsitem.BlockGroup
}

type FoundChunk

type FoundChunk = btrfstree.SysChunk

type FoundDevExtent

type FoundDevExtent struct {
	Key    btrfsprim.Key
	DevExt btrfsitem.DevExtent
}

type FoundExtentCSum

type FoundExtentCSum struct {
	Generation btrfsprim.Generation
	Sums       btrfsitem.ExtentCSum
}

func (FoundExtentCSum) Compare

func (a FoundExtentCSum) Compare(b FoundExtentCSum) int

Compare implements containers.Ordered.

type ScanDevicesResult

type ScanDevicesResult = map[btrfsvol.DeviceID]ScanOneDeviceResult

func ScanDevices

func ScanDevices(ctx context.Context, fs *btrfs.FS) (ScanDevicesResult, error)

type ScanOneDeviceResult

type ScanOneDeviceResult struct {
	Checksums        btrfssum.SumRun[btrfsvol.PhysicalAddr]
	FoundNodes       map[btrfsvol.LogicalAddr][]btrfsvol.PhysicalAddr
	FoundChunks      []FoundChunk
	FoundBlockGroups []FoundBlockGroup
	FoundDevExtents  []FoundDevExtent
	FoundExtentCSums []FoundExtentCSum
}

func ScanOneDevice

func ScanOneDevice(ctx context.Context, dev *btrfs.Device) (ScanOneDeviceResult, error)

ScanOneDevice mostly mimics btrfs-progs cmds/rescue-chunk-recover.c:scan_one_device().

Jump to

Keyboard shortcuts

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