]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix frag string rendering
authorSage Weil <sage.weil@dreamhost.com>
Thu, 24 Feb 2011 15:50:17 +0000 (07:50 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Thu, 24 Feb 2011 15:50:17 +0000 (07:50 -0800)
Was mostly gibberish from df7c7bd79237d2a8b691f4e59433b0b39a9721a2

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/include/frag.h

index 2f9839b14270df59b4edeb103872f9ed4b88ca1a..16c950f962748a00bccb1594b40d668781c42879 100644 (file)
@@ -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<<bit)) ? '1':'0');
   }
   return out << '*';
 }