diff options
Diffstat (limited to 'lib/btrfsprogs')
-rw-r--r-- | lib/btrfsprogs/btrfsinspect/print_tree.go | 2 | ||||
-rw-r--r-- | lib/btrfsprogs/btrfsrepair/clearnodes.go | 2 | ||||
-rw-r--r-- | lib/btrfsprogs/btrfsutil/walk.go | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/btrfsprogs/btrfsinspect/print_tree.go b/lib/btrfsprogs/btrfsinspect/print_tree.go index 6c4f550..142f5e5 100644 --- a/lib/btrfsprogs/btrfsinspect/print_tree.go +++ b/lib/btrfsprogs/btrfsinspect/print_tree.go @@ -44,6 +44,7 @@ func DumpTrees(ctx context.Context, out io.Writer, fs *btrfs.FS) { printTree(ctx, out, fs, btrfs.BLOCK_GROUP_TREE_OBJECTID) } fs.TreeWalk( + ctx, btrfs.ROOT_TREE_OBJECTID, func(err *btrfs.TreeError) { dlog.Error(ctx, err) @@ -343,6 +344,7 @@ func printTree(ctx context.Context, out io.Writer, fs *btrfs.FS, treeID btrfs.Ob } handlers.BadItem = handlers.Item fs.TreeWalk( + ctx, treeID, func(err *btrfs.TreeError) { dlog.Error(ctx, err) diff --git a/lib/btrfsprogs/btrfsrepair/clearnodes.go b/lib/btrfsprogs/btrfsrepair/clearnodes.go index dbe1c3a..b38a333 100644 --- a/lib/btrfsprogs/btrfsrepair/clearnodes.go +++ b/lib/btrfsprogs/btrfsrepair/clearnodes.go @@ -21,7 +21,7 @@ func ClearBadNodes(ctx context.Context, fs *btrfs.FS) error { var uuidsInited bool var metadataUUID, chunkTreeUUID btrfs.UUID - btrfsutil.WalkAllTrees(fs, btrfsutil.WalkAllTreesHandler{ + btrfsutil.WalkAllTrees(ctx, fs, btrfsutil.WalkAllTreesHandler{ Err: func(err *btrfsutil.WalkError) { dlog.Error(ctx, err) }, diff --git a/lib/btrfsprogs/btrfsutil/walk.go b/lib/btrfsprogs/btrfsutil/walk.go index d2b6367..c597e5e 100644 --- a/lib/btrfsprogs/btrfsutil/walk.go +++ b/lib/btrfsprogs/btrfsutil/walk.go @@ -5,6 +5,7 @@ package btrfsutil import ( + "context" "fmt" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" @@ -34,7 +35,7 @@ type WalkAllTreesHandler struct { // WalkAllTrees walks all trees in a *btrfs.FS. Rather than returning // an error, it calls errCb each time an error is encountered. The // error will always be of type WalkError. -func WalkAllTrees(fs *btrfs.FS, cbs WalkAllTreesHandler) { +func WalkAllTrees(ctx context.Context, fs *btrfs.FS, cbs WalkAllTreesHandler) { var treeName string trees := []struct { @@ -83,6 +84,7 @@ func WalkAllTrees(fs *btrfs.FS, cbs WalkAllTreesHandler) { cbs.PreTree(treeName, tree.ID) } fs.TreeWalk( + ctx, tree.ID, func(err *btrfs.TreeError) { cbs.Err(&WalkError{TreeName: treeName, Err: err}) }, cbs.TreeWalkHandler, |