# HG changeset patch # User Michael Spacefalcon # Date 1372660110 0 # Node ID e9c6d6615f323bf082202bcf05b84799c00e5c26 # Parent 8256eec598ddd23ec035a376fa24fb6e1515a37f mpffs-dbgls: reworked for the new understanding of relocated chunks diff -r 8256eec598dd -r e9c6d6615f32 mpffs/dbgls.c --- a/mpffs/dbgls.c Sun Jun 30 17:56:27 2013 +0000 +++ b/mpffs/dbgls.c Mon Jul 01 06:28:30 2013 +0000 @@ -28,23 +28,34 @@ struct chunkinfo chi; for (ent = first_extra_chunk; ent != 0xFFFF; ent = ch.descend) { - ch.entryno = ent; +loop: ch.entryno = ent; get_index_entry(&ch); - if (ch.type != 0xF4) { - fprintf(stderr, - "file continuation object at index %x: type %02X != expected F4\n", + switch (ch.type) { + case 0xF4: + validate_chunk(&ch); + printf(" #%x chunk addr=0x%x len=0x%x\n", ch.entryno, + ch.offset, ch.len); + size_extra_chunk(&ch, &chi); + printf(" extra chunk: %lu bytes at 0x%lx\n", + (u_long) chi.len, (u_long)(chi.start-image)); + break; + case 0x00: + printf(" #%x marked as deleted\n", ch.entryno); + if (ch.sibling == 0xFFFF) { + printf(" nil sibling pointer!\n"); + break; + } + ent = ch.sibling; + printf(" relocated to #%x\n", ent); + goto loop; + default: + printf( + " file continuation object at index %x: unexpected type %02X\n", ent, ch.type); - return; } - validate_chunk(&ch); - printf(" #%x chunk addr=0x%x len=0x%x\n", ch.entryno, - ch.offset, ch.len); - size_extra_chunk(&ch, &chi); - printf(" extra chunk: %lu bytes at 0x%lx\n", (u_long) chi.len, - (u_long)(chi.start-image)); if (ch.sibling != 0xFFFF) - fprintf(stderr, -"warning: file continuation object (index %x) has a non-nil sibling pointer\n", + printf( + " file continuation object (index %x) has a non-nil sibling pointer\n", ent); } } @@ -63,7 +74,7 @@ break; case 0xF1: /* regular file */ - typechar = '-'; + typechar = 'f'; break; case 0xE1: /* special .journal file */