From 2ee7091933d2c07338dfb4699ce5665951b47afd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 16 Mar 2023 18:38:11 -0400 Subject: tree-wide: Ensure that all packages have a doc comment --- cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmd/btrfs-rec/inspect/rebuildtrees') diff --git a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go index 708b504..364dfa0 100644 --- a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go +++ b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go @@ -2,6 +2,10 @@ // // SPDX-License-Identifier: GPL-2.0-or-later +// 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. package rebuildtrees import ( -- cgit v1.2.3-2-g168b From c30c43f3690931218b88680b337d11a57a2fdc45 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 17 Mar 2023 01:46:40 -0400 Subject: tree-wide: Ensure that all existing type doc comments follow the expected format This is a notable improvement in the docs for btrfsitem. --- cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wanttyp.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd/btrfs-rec/inspect/rebuildtrees') diff --git a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wanttyp.go b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wanttyp.go index 4aab669..8fe8a49 100644 --- a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wanttyp.go +++ b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wanttyp.go @@ -23,8 +23,9 @@ const ( offsetName ) -// TODO(lukeshu): Delete the 'Want' type in favor of btrfstree.Search. type Want struct { + // TODO(lukeshu): Delete the 'Want' type in favor of + // btrfstree.Search. ObjectID btrfsprim.ObjID ItemType btrfsprim.ItemType OffsetType wantOffsetType -- cgit v1.2.3-2-g168b From 1ea26f04701fa66e36b058f3efb3a6c7059cdc5c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 17 Mar 2023 02:28:54 -0400 Subject: tree-wide: Turn on all revive linters (with exceptions) --- cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go | 2 +- cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go | 4 ++-- cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'cmd/btrfs-rec/inspect/rebuildtrees') diff --git a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go index 364dfa0..ca1ce8c 100644 --- a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go +++ b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go @@ -286,7 +286,7 @@ func (o *rebuilder) processSettledItemQueue(ctx context.Context) error { ctx := dlog.WithField(ctx, "btrfs.inspect.rebuild-trees.rebuild.process.item", item.keyAndTree) o.curKey.TreeID = item.TreeID o.curKey.Key.Val = item.Key - btrfscheck.HandleItem(o, ctx, item.TreeID, btrfstree.Item{ + btrfscheck.HandleItem(ctx, o, item.TreeID, btrfstree.Item{ Key: item.Key, Body: item.Body, }) diff --git a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go index e6a0777..a422a47 100644 --- a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go +++ b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go @@ -14,7 +14,7 @@ import ( ) // AddedItem implements btrfsutil.RebuiltForrestCallbacks. -func (o *rebuilder) AddedItem(ctx context.Context, tree btrfsprim.ObjID, key btrfsprim.Key) { +func (o *rebuilder) AddedItem(_ context.Context, tree btrfsprim.ObjID, key btrfsprim.Key) { o.addedItemQueue.Insert(keyAndTree{ TreeID: tree, Key: key, @@ -22,7 +22,7 @@ func (o *rebuilder) AddedItem(ctx context.Context, tree btrfsprim.ObjID, key btr } // AddedRoot implements btrfsutil.RebuiltForrestCallbacks. -func (o *rebuilder) AddedRoot(ctx context.Context, tree btrfsprim.ObjID, root btrfsvol.LogicalAddr) { +func (o *rebuilder) AddedRoot(_ context.Context, tree btrfsprim.ObjID, _ btrfsvol.LogicalAddr) { if retries := o.retryItemQueue[tree]; retries != nil { o.addedItemQueue.InsertFrom(retries) } diff --git a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go index 4a5029e..704f4ee 100644 --- a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go +++ b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go @@ -20,7 +20,7 @@ import ( ) // FSErr implements btrfscheck.GraphCallbacks. -func (o *rebuilder) FSErr(ctx context.Context, e error) { +func (*rebuilder) FSErr(ctx context.Context, e error) { dlog.Errorf(ctx, "filesystem error: %v", e) } -- cgit v1.2.3-2-g168b