summaryrefslogtreecommitdiff
path: root/lib/btrfsprogs
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-06 02:49:05 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-02-12 16:20:05 -0700
commit0ffd1a5540201c4b0161b7fea32564adff01f4b2 (patch)
tree8d6e6c14018c8ce573dee1e9b876df3b8ab4af8f /lib/btrfsprogs
parentc9549dc423a38839d9f8b919877009abba74c607 (diff)
rebuildnodes: Having the treeAugmentQueue instance be named treeQueue is confusing
Since there's also Rebuilder.treeQueue.
Diffstat (limited to 'lib/btrfsprogs')
-rw-r--r--lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go48
1 files changed, 24 insertions, 24 deletions
diff --git a/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go b/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go
index da3d79f..a088d84 100644
--- a/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go
+++ b/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go
@@ -498,21 +498,21 @@ func shortenWantKey(wantKey string) string {
return wantKey[sp+1:]
}
-func (treeQueue *treeAugmentQueue) has(wantKey string) bool {
- if treeQueue != nil {
+func (queue *treeAugmentQueue) has(wantKey string) bool {
+ if queue != nil {
wantKey = shortenWantKey(wantKey)
- if treeQueue.zero != nil {
- if _, ok := treeQueue.zero[wantKey]; ok {
+ if queue.zero != nil {
+ if _, ok := queue.zero[wantKey]; ok {
return true
}
}
- if treeQueue.single != nil {
- if _, ok := treeQueue.single[wantKey]; ok {
+ if queue.single != nil {
+ if _, ok := queue.single[wantKey]; ok {
return true
}
}
- if treeQueue.multi != nil {
- if _, ok := treeQueue.multi[wantKey]; ok {
+ if queue.multi != nil {
+ if _, ok := queue.multi[wantKey]; ok {
return true
}
}
@@ -520,37 +520,37 @@ func (treeQueue *treeAugmentQueue) has(wantKey string) bool {
return false
}
-func (treeQueue *treeAugmentQueue) store(wantKey string, choices containers.Set[btrfsvol.LogicalAddr]) {
+func (queue *treeAugmentQueue) store(wantKey string, choices containers.Set[btrfsvol.LogicalAddr]) {
if len(choices) == 0 && (strings.Contains(wantKey, " name=") || strings.Contains(wantKey, "-")) {
// This wantKey is unlikely to come up again, so it's not worth storing a negative result.
return
}
wantKey = shortenWantKey(wantKey)
- beg := treeQueue.keyBuf.Len()
- if treeQueue.keyBuf.Cap()-beg < len(wantKey) {
- treeQueue.keyBuf.Reset()
- treeQueue.keyBuf.Grow(textui.Tunable(4096))
+ beg := queue.keyBuf.Len()
+ if queue.keyBuf.Cap()-beg < len(wantKey) {
+ queue.keyBuf.Reset()
+ queue.keyBuf.Grow(textui.Tunable(4096))
beg = 0
}
- treeQueue.keyBuf.WriteString(wantKey)
- wantKey = treeQueue.keyBuf.String()[beg:]
+ queue.keyBuf.WriteString(wantKey)
+ wantKey = queue.keyBuf.String()[beg:]
switch len(choices) {
case 0:
- if treeQueue.zero == nil {
- treeQueue.zero = make(map[string]struct{})
+ if queue.zero == nil {
+ queue.zero = make(map[string]struct{})
}
- treeQueue.zero[wantKey] = struct{}{}
+ queue.zero[wantKey] = struct{}{}
case 1:
- if treeQueue.single == nil {
- treeQueue.single = make(map[string]btrfsvol.LogicalAddr)
+ if queue.single == nil {
+ queue.single = make(map[string]btrfsvol.LogicalAddr)
}
- treeQueue.single[wantKey] = choices.TakeOne()
+ queue.single[wantKey] = choices.TakeOne()
default:
- if treeQueue.multi == nil {
- treeQueue.multi = make(map[string]containers.Set[btrfsvol.LogicalAddr])
+ if queue.multi == nil {
+ queue.multi = make(map[string]containers.Set[btrfsvol.LogicalAddr])
}
- treeQueue.multi[wantKey] = choices
+ queue.multi[wantKey] = choices
}
}