+func (bs *BlockState) increaseDesired(pdh string, classes []string, n int) {
+ if pdh != "" && len(bs.Replicas) == 0 {
+ // Note we only track PDHs if there's a possibility
+ // that we will report the list of referring PDHs,
+ // i.e., if we haven't yet seen a replica.
+ if bs.Refs == nil {
+ bs.Refs = map[string]bool{}
+ }
+ bs.Refs[pdh] = true
+ }
+ bs.RefCount++
+ if len(classes) == 0 {
+ classes = defaultClasses
+ }
+ for _, class := range classes {
+ if bs.Desired == nil {
+ bs.Desired = map[string]int{class: n}
+ } else if d, ok := bs.Desired[class]; !ok || d < n {
+ bs.Desired[class] = n
+ }