From 0f3fe7f8f3e6f5929a4ee5ded70fba8a4ccc65e0 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 24 Feb 2011 07:50:17 -0800 Subject: [PATCH] mds: fix frag string rendering Was mostly gibberish from df7c7bd79237d2a8b691f4e59433b0b39a9721a2 Signed-off-by: Sage Weil --- src/include/frag.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/include/frag.h b/src/include/frag.h index 2f9839b14270d..16c950f962748 100644 --- a/src/include/frag.h +++ b/src/include/frag.h @@ -149,15 +149,12 @@ class frag_t { inline std::ostream& operator<<(std::ostream& out, frag_t hb) { - //return out << std::hex << hb.value() << std::dec << "/" << hb.bits(); + //out << std::hex << hb.value() << std::dec << "/" << hb.bits() << '='; unsigned num = hb.bits(); if (num) { unsigned val = hb.value(); - unsigned bit = 1 << hb.mask_shift(); - while (num--) { - out << ((val & bit) ? '1':'0'); - bit--; - } + for (unsigned bit = 23; num; num--, bit--) + out << ((val & (1<