func (b *blockvolGC) IsDead(ref torus.BlockRef) bool { v, ok := b.highwaters[ref.Volume()] if !ok { if clog.LevelAt(capnslog.TRACE) { clog.Tracef("%s doesn't exist anymore", ref) } // Volume doesn't exist anymore return true } // If it's a new block or INode, let it be. if ref.INode >= v { if clog.LevelAt(capnslog.TRACE) { clog.Tracef("%s is new compared to %d", ref, v) } return false } // If it's an INode block, and it's not in our list if ref.BlockType() == torus.TypeINode { for _, x := range b.curINodes { if ref.HasINode(x, torus.TypeINode) { if clog.LevelAt(capnslog.TRACE) { clog.Tracef("%s is in %s", ref, x) } return false } } if clog.LevelAt(capnslog.TRACE) { clog.Tracef("%s is a dead INode", ref) } return true } // If it's a data block if v := b.set[ref]; v { return false } if clog.LevelAt(capnslog.TRACE) { clog.Tracef("%s is dead", ref) } return true }