summaryrefslogtreecommitdiff
path: root/lib/btrfscheck/graph.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-03-12 17:09:51 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2023-03-14 19:45:07 -0600
commit84099499feb558a01253bd272563fa1271527a75 (patch)
treeddcf4e76b9b2336f5c18827ad1feb7b3f4f4c608 /lib/btrfscheck/graph.go
parent1be85fecedebe9ea37b910a15a5c45dd2e57649d (diff)
Update identifiers and comments to reflect new file/package names
Diffstat (limited to 'lib/btrfscheck/graph.go')
-rw-r--r--lib/btrfscheck/graph.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/btrfscheck/graph.go b/lib/btrfscheck/graph.go
index c35baf8..ea51818 100644
--- a/lib/btrfscheck/graph.go
+++ b/lib/btrfscheck/graph.go
@@ -14,7 +14,7 @@ import (
"git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol"
)
-type rebuildCallbacks interface {
+type GraphCallbacks interface {
FSErr(ctx context.Context, e error)
Want(ctx context.Context, reason string, treeID btrfsprim.ObjID, objID btrfsprim.ObjID, typ btrfsprim.ItemType)
WantOff(ctx context.Context, reason string, treeID btrfsprim.ObjID, objID btrfsprim.ObjID, typ btrfsprim.ItemType, off uint64)
@@ -23,9 +23,9 @@ type rebuildCallbacks interface {
WantFileExt(ctx context.Context, reason string, treeID btrfsprim.ObjID, ino btrfsprim.ObjID, size int64)
}
-// handleWouldBeNoOp returns whether or not a call to handleItem for a
-// given item type would be a no-op.
-func HandleWouldBeNoOp(typ btrfsprim.ItemType) bool {
+// HandleItemWouldBeNoOp returns whether or not a call to HandleItem
+// for a given item type would be a no-op.
+func HandleItemWouldBeNoOp(typ btrfsprim.ItemType) bool {
switch typ {
case // btrfsitem.Dev
btrfsprim.DEV_ITEM_KEY,
@@ -45,7 +45,7 @@ func HandleWouldBeNoOp(typ btrfsprim.ItemType) bool {
}
}
-func HandleItem(o rebuildCallbacks, ctx context.Context, treeID btrfsprim.ObjID, item btrfstree.Item) {
+func HandleItem(o GraphCallbacks, ctx context.Context, treeID btrfsprim.ObjID, item btrfstree.Item) {
// Notionally, just express the relationships shown in
// https://btrfs.wiki.kernel.org/index.php/File:References.png (from the page
// https://btrfs.wiki.kernel.org/index.php/Data_Structures )
@@ -186,7 +186,7 @@ func HandleItem(o rebuildCallbacks, ctx context.Context, treeID btrfsprim.ObjID,
case btrfsitem.FILE_EXTENT_INLINE:
// nothing
case btrfsitem.FILE_EXTENT_REG, btrfsitem.FILE_EXTENT_PREALLOC:
- // NB: o.wantCSum checks inodeBody.Flags.Has(btrfsitem.INODE_NODATASUM) for us.
+ // NB: o.WantCSum checks inodeBody.Flags.Has(btrfsitem.INODE_NODATASUM) for us.
o.WantCSum(ctx, "data sum",
treeID, item.Key.ObjectID,
body.BodyExtent.DiskByteNr,