diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-06-26 21:27:55 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-06-26 22:19:41 -0600 |
commit | 64c04fc690ec5a276e11500691173962bbe4d99e (patch) | |
tree | f01996f95da88c38ee4bc1aa3691dc650eebf2e7 /cmd/btrfs-fsck/pass1.go | |
parent | bfb830d024fd6309d81e20a7d21a2433c4ec9c93 (diff) |
fuss with exposing .LV and how init happens
Diffstat (limited to 'cmd/btrfs-fsck/pass1.go')
-rw-r--r-- | cmd/btrfs-fsck/pass1.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/cmd/btrfs-fsck/pass1.go b/cmd/btrfs-fsck/pass1.go index 7798650..aada80d 100644 --- a/cmd/btrfs-fsck/pass1.go +++ b/cmd/btrfs-fsck/pass1.go @@ -18,11 +18,6 @@ import ( func pass1(fs *btrfs.FS, superblock *util.Ref[btrfs.PhysicalAddr, btrfs.Superblock]) (map[btrfs.LogicalAddr]struct{}, error) { fmt.Printf("\nPass 1: chunk mappings...\n") - fmt.Printf("Pass 1: ... initializing chunk mappings\n") - if err := fs.Init(); err != nil { - fmt.Printf("Pass 1: ... init chunk tree: error: %v\n", err) - } - fmt.Printf("Pass 1: ... walking fs\n") visitedNodes := make(map[btrfs.LogicalAddr]struct{}) btrfsmisc.WalkFS(fs, btrfs.WalkTreeHandler{ @@ -45,7 +40,7 @@ func pass1(fs *btrfs.FS, superblock *util.Ref[btrfs.PhysicalAddr, btrfs.Superblo Size btrfs.AddrDelta Stripes []btrfsitem.ChunkStripe }) - for _, dev := range fs.Devices() { + for _, dev := range fs.LV.PhysicalVolumes() { fmt.Printf("Pass 1: ... dev[%q] scanning for nodes...\n", dev.Name()) devResult, err := pass1ScanOneDev(dev, superblock.Data) if err != nil { @@ -506,7 +501,7 @@ func pass1WriteReconstructedChunks( }, } - for _, dev := range fs.Devices() { + for _, dev := range fs.LV.PhysicalVolumes() { superblock, _ := dev.Superblock() reconstructedNode.Data.BodyLeaf = append(reconstructedNode.Data.BodyLeaf, btrfs.Item{ Head: btrfs.ItemHeader{ @@ -568,7 +563,7 @@ func pass1WriteReconstructedChunks( fmt.Printf("Pass 1: ... write new node: error: %v\n", err) } - if err := fs.Init(); err != nil { + if err := fs.ReInit(); err != nil { fmt.Printf("Pass 1: ... re-init mappings: %v\n", err) } } |