diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-02 16:02:42 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-23 11:57:55 -0600 |
commit | b8185f8e741bd81e0d6f6416e46e11f6f7570995 (patch) | |
tree | 623581e503f056267091ef94f0c9c7f4d30924ff /lib/btrfs/io2_lv.go | |
parent | 6ebccb12a4234e6202afb4aa362aa97d125e089e (diff) |
btrfstree: Fuss with the TreeWalk API
Diffstat (limited to 'lib/btrfs/io2_lv.go')
-rw-r--r-- | lib/btrfs/io2_lv.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/btrfs/io2_lv.go b/lib/btrfs/io2_lv.go index d05d51f..9f4e53f 100644 --- a/lib/btrfs/io2_lv.go +++ b/lib/btrfs/io2_lv.go @@ -168,15 +168,15 @@ func (fs *FS) initDev(ctx context.Context, sb btrfstree.Superblock) error { errs = append(errs, err) }, btrfstree.TreeWalkHandler{ - Item: func(_ btrfstree.Path, item btrfstree.Item) error { + Item: func(_ btrfstree.Path, item btrfstree.Item) { if item.Key.ItemType != btrfsitem.CHUNK_ITEM_KEY { - return nil + return } switch itemBody := item.Body.(type) { case *btrfsitem.Chunk: for _, mapping := range itemBody.Mappings(item.Key) { if err := fs.LV.AddMapping(mapping); err != nil { - return err + errs = append(errs, err) } } case *btrfsitem.Error: @@ -187,7 +187,6 @@ func (fs *FS) initDev(ctx context.Context, sb btrfstree.Superblock) error { // updated. panic(fmt.Errorf("should not happen: CHUNK_ITEM has unexpected item type: %T", itemBody)) } - return nil }, }, ) |