From 43eda94ec110d0bcba39381fb16cb04a978996ed Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Wed, 2 Apr 2014 07:44:54 -0600 Subject: Remove count and overflow columns for free pages on 'bolt pages'. The count and overflow columns are meaningless for freed pages since there could be random overflow data in there. This commit removes those columns for free pages. --- cmd/bolt/pages.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cmd/bolt/pages.go b/cmd/bolt/pages.go index ab2b67d..33f6886 100644 --- a/cmd/bolt/pages.go +++ b/cmd/bolt/pages.go @@ -34,11 +34,19 @@ func Pages(path string) { break } - var overflow string - if p.OverflowCount > 0 { - overflow = strconv.Itoa(p.OverflowCount) + // Only display count and overflow if this is a non-free page. + var count, overflow string + if p.Type != "free" { + count = strconv.Itoa(p.Count) + if p.OverflowCount > 0 { + overflow = strconv.Itoa(p.OverflowCount) + } } - printf("%-8d %-10s %-6d %-6s\n", p.ID, p.Type, p.Count, overflow) + + // Print table row. + printf("%-8d %-10s %-6s %-6s\n", p.ID, p.Type, count, overflow) + + // Move to the next non-overflow page. id += 1 if p.Type != "free" { id += p.OverflowCount -- cgit v1.2.3