2 * Copyright (c) 2008 The DragonFly Project. All rights reserved.
4 * This code is derived from software contributed to The DragonFly Project
5 * by Matthew Dillon <dillon@backplane.com>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * 3. Neither the name of The DragonFly Project nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific, prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 #define FLAG_TOOFARLEFT 0x0001
40 #define FLAG_TOOFARRIGHT 0x0002
41 #define FLAG_BADTYPE 0x0004
42 #define FLAG_BADCHILDPARENT 0x0008
43 #define FLAG_BADMIRRORTID 0x0010
45 typedef struct btree_search {
50 hammer_tid_t create_tid;
51 int limit; /* # of fields to test */
52 int filter; /* filter type (default -1) */
55 static void print_btree_node(hammer_off_t node_offset, btree_search_t search,
56 int depth, hammer_tid_t mirror_tid,
57 hammer_base_elm_t left_bound,
58 hammer_base_elm_t right_bound,
59 struct zone_stat *stats);
60 static const char *check_data_crc(hammer_btree_elm_t elm);
61 static void print_record(hammer_btree_elm_t elm);
62 static void print_btree_elm(hammer_btree_elm_t elm, int i, u_int8_t type,
63 int flags, const char *label, const char *ext,
64 struct zone_stat *stats);
65 static int get_elm_flags(hammer_node_ondisk_t node, hammer_off_t node_offset,
66 hammer_btree_elm_t elm, u_int8_t btype,
67 hammer_base_elm_t left_bound,
68 hammer_base_elm_t right_bound);
69 static void print_bigblock_fill(hammer_off_t offset);
70 static int init_btree_search(const char *arg, int filter,
71 btree_search_t search);
72 static int test_btree_search(hammer_btree_elm_t elm, btree_search_t search);
74 static int num_bad_node = 0;
75 static int num_bad_elm = 0;
78 hammer_cmd_show(hammer_off_t node_offset, const char *arg,
79 int filter, int depth,
80 hammer_base_elm_t left_bound, hammer_base_elm_t right_bound)
82 struct volume_info *volume;
83 struct btree_search search;
84 btree_search_t searchp = NULL;
85 struct zone_stat *stats = NULL;
88 AssertOnFailure = (DebugOpt != 0);
91 stats = hammer_init_zone_stat_bits();
93 if (node_offset == (hammer_off_t)-1) {
94 volume = get_volume(RootVolNo);
95 node_offset = volume->ondisk->vol0_btree_root;
97 printf("Volume header\trecords=%jd next_tid=%016jx\n",
98 (intmax_t)volume->ondisk->vol0_stat_records,
99 (uintmax_t)volume->ondisk->vol0_next_tid);
100 printf("\t\tbufoffset=%016jx\n",
101 (uintmax_t)volume->ondisk->vol_buf_beg);
102 for (zone = 0; zone < HAMMER_MAX_ZONES; ++zone) {
103 printf("\t\tzone %d\tnext_offset=%016jx\n",
105 (uintmax_t)volume->ondisk->vol0_blockmap[zone].next_offset
112 printf("show %016jx", (uintmax_t)node_offset);
114 assert(init_btree_search(arg, filter, &search) != -1);
115 if (search.limit >= 1)
116 printf(" lo %08x obj_id %016jx",
117 search.lo, (uintmax_t)search.obj_id);
118 if (search.limit >= 3)
119 printf(" rec_type %02x", search.rec_type);
120 if (search.limit >= 4)
121 printf(" key %016jx", (uintmax_t)search.key);
122 if (search.limit == 5)
123 printf(" create_tid %016jx\n",
124 (uintmax_t)search.create_tid);
127 printf(" depth %d\n", depth);
128 print_btree_node(node_offset, searchp, depth, HAMMER_MAX_TID,
129 left_bound, right_bound, stats);
134 hammer_print_zone_stat(stats);
135 hammer_cleanup_zone_stat(stats);
138 if (num_bad_node || VerboseOpt) {
139 printf("%d bad nodes\n", num_bad_node);
141 if (num_bad_elm || VerboseOpt) {
142 printf("%d bad elms\n", num_bad_elm);
147 print_btree_node(hammer_off_t node_offset, btree_search_t search,
148 int depth, hammer_tid_t mirror_tid,
149 hammer_base_elm_t left_bound, hammer_base_elm_t right_bound,
150 struct zone_stat *stats)
152 struct buffer_info *buffer = NULL;
153 hammer_node_ondisk_t node;
154 hammer_btree_elm_t elm;
158 char badc = ' '; /* good */
159 char badm = ' '; /* good */
162 node = get_node(node_offset, &buffer);
168 if (crc32(&node->crc + 1, HAMMER_BTREE_CRCSIZE) != node->crc)
170 if (node->mirror_tid > mirror_tid) {
174 maxcount = hammer_node_max_elements(node->type);
175 if (maxcount == -1) {
178 } else if (node->count == 0 || node->count > maxcount) {
184 if (badm != ' ' || badc != ' ') /* not good */
187 printf("%c%c NODE %016jx ", badc, badm, (uintmax_t)node_offset);
189 printf("(IO ERROR)\n");
193 printf("cnt=%02d p=%016jx type=%c depth=%d mirror=%016jx",
195 (uintmax_t)node->parent,
196 (node->type ? node->type : '?'),
198 (uintmax_t)node->mirror_tid);
201 print_bigblock_fill(node_offset);
204 printf(" sign=%04x", node->signature);
208 hammer_add_zone_stat(stats, node_offset, sizeof(*node));
210 for (i = 0; i < node->count; ++i) {
211 elm = &node->elms[i];
213 if (node->type != HAMMER_BTREE_TYPE_INTERNAL) {
215 if (search && test_btree_search(elm, search) == 0)
219 if (test_btree_search(elm, search) > 0 ||
220 test_btree_search(elm + 1, search) < 0)
226 flags = get_elm_flags(node, node_offset, elm,
228 left_bound, right_bound);
229 print_btree_elm(elm, i, node->type, flags, "ELM", ext, stats);
231 if (node->type == HAMMER_BTREE_TYPE_INTERNAL) {
232 assert(i == node->count); /* boundary */
233 elm = &node->elms[i];
235 flags = get_elm_flags(node, node_offset, elm,
236 HAMMER_BTREE_TYPE_INTERNAL,
237 left_bound, right_bound);
238 print_btree_elm(elm, i, node->type, flags, "RBN", NULL, stats);
242 for (i = 0; i < node->count; ++i) {
243 elm = &node->elms[i];
246 case HAMMER_BTREE_TYPE_INTERNAL:
247 if (search && search->filter) {
248 if (test_btree_search(elm, search) > 0 ||
249 test_btree_search(elm + 1, search) < 0)
252 if (elm->internal.subtree_offset) {
253 print_btree_node(elm->internal.subtree_offset,
255 elm->internal.mirror_tid,
256 &elm[0].base, &elm[1].base,
259 * Cause show to do normal iteration after
260 * seeking to the lo:objid:rectype:key:tid
263 if (search && search->filter == -1) /* default */
276 is_root_btree_beg(u_int8_t type, int i, hammer_btree_elm_t elm)
279 * elm->base.btype depends on what the original node had
280 * so it could be anything but HAMMER_BTREE_TYPE_NONE.
282 return (type == HAMMER_BTREE_TYPE_INTERNAL &&
284 elm->base.localization == 0 &&
285 elm->base.obj_id == (int64_t)-0x8000000000000000LL &&
286 elm->base.key == (int64_t)-0x8000000000000000LL &&
287 elm->base.create_tid == 1 &&
288 elm->base.delete_tid == 1 &&
289 elm->base.rec_type == 0 &&
290 elm->base.obj_type == 0 &&
291 elm->base.btype != HAMMER_BTREE_TYPE_NONE);
296 is_root_btree_end(u_int8_t type, int i, hammer_btree_elm_t elm)
298 return (type == HAMMER_BTREE_TYPE_INTERNAL &&
300 elm->base.localization == 0xFFFFFFFFU &&
301 elm->base.obj_id == 0x7FFFFFFFFFFFFFFFLL &&
302 elm->base.key == 0x7FFFFFFFFFFFFFFFLL &&
303 elm->base.create_tid == 0xFFFFFFFFFFFFFFFFULL &&
304 elm->base.delete_tid == 0 &&
305 elm->base.rec_type == 0xFFFFU &&
306 elm->base.obj_type == 0 &&
307 elm->base.btype == HAMMER_BTREE_TYPE_NONE);
312 print_btree_elm(hammer_btree_elm_t elm, int i, u_int8_t type,
313 int flags, const char *label, const char *ext,
314 struct zone_stat *stats)
316 char flagstr[8] = { 0, '-', '-', '-', '-', '-', '-', 0 };
320 flagstr[0] = flags ? 'B' : 'G';
321 if (flags & FLAG_TOOFARLEFT)
323 if (flags & FLAG_TOOFARRIGHT)
325 if (flags & FLAG_BADTYPE)
327 if (flags & FLAG_BADCHILDPARENT)
329 if (flags & FLAG_BADMIRRORTID)
331 if (flagstr[0] == 'B')
335 * Check if elm is derived from root split
337 if (is_root_btree_beg(type, i, elm))
339 else if (is_root_btree_end(type, i, elm))
344 if (elm->base.delete_tid)
349 printf("%s\t%s %2d %c ", flagstr, label, i, hammer_elm_btype(elm));
350 printf("lo=%08x obj=%016jx rt=%02x key=%016jx ot=%02x\n",
351 elm->base.localization,
352 (uintmax_t)elm->base.obj_id,
354 (uintmax_t)elm->base.key,
356 printf("\t %c tids=%016jx:%016jx ",
357 (rootelm == ' ' ? deleted : rootelm),
358 (uintmax_t)elm->base.create_tid,
359 (uintmax_t)elm->base.delete_tid);
362 case HAMMER_BTREE_TYPE_INTERNAL:
363 printf("suboff=%016jx",
364 (uintmax_t)elm->internal.subtree_offset);
366 printf(" mirror=%016jx",
367 (uintmax_t)elm->internal.mirror_tid);
372 case HAMMER_BTREE_TYPE_LEAF:
375 switch(elm->base.btype) {
376 case HAMMER_BTREE_TYPE_RECORD:
378 printf("\n%s\t ", check_data_crc(elm));
381 printf("dataoff=%016jx/%d",
382 (uintmax_t)elm->leaf.data_offset,
385 printf(" crc=%04x", elm->leaf.data_crc);
386 printf("\n\t fill=");
387 print_bigblock_fill(elm->leaf.data_offset);
392 hammer_add_zone_stat(stats,
393 elm->leaf.data_offset,
398 printf("badtype=%d", elm->base.btype);
410 get_elm_flags(hammer_node_ondisk_t node, hammer_off_t node_offset,
411 hammer_btree_elm_t elm, u_int8_t btype,
412 hammer_base_elm_t left_bound, hammer_base_elm_t right_bound)
417 case HAMMER_BTREE_TYPE_INTERNAL:
418 if (elm->internal.subtree_offset) {
419 struct buffer_info *buffer = NULL;
420 hammer_node_ondisk_t subnode;
422 subnode = get_node(elm->internal.subtree_offset,
425 flags |= FLAG_BADCHILDPARENT;
426 else if (subnode->parent != node_offset)
427 flags |= FLAG_BADCHILDPARENT;
430 if (elm->internal.mirror_tid > node->mirror_tid)
431 flags |= FLAG_BADMIRRORTID;
434 case HAMMER_BTREE_TYPE_INTERNAL:
435 if (left_bound == NULL || right_bound == NULL)
437 if (hammer_btree_cmp(&elm->base, left_bound) < 0)
438 flags |= FLAG_TOOFARLEFT;
439 if (hammer_btree_cmp(&elm->base, right_bound) > 0)
440 flags |= FLAG_TOOFARRIGHT;
442 case HAMMER_BTREE_TYPE_LEAF:
443 if (left_bound == NULL || right_bound == NULL)
445 if (hammer_btree_cmp(&elm->base, left_bound) < 0)
446 flags |= FLAG_TOOFARLEFT;
447 if (hammer_btree_cmp(&elm->base, right_bound) >= 0)
448 flags |= FLAG_TOOFARRIGHT;
451 flags |= FLAG_BADTYPE;
455 case HAMMER_BTREE_TYPE_LEAF:
456 if (node->mirror_tid == 0 &&
457 !(node->parent == 0 && node->count == 2)) {
458 flags |= FLAG_BADMIRRORTID;
460 if (elm->base.create_tid && node->mirror_tid &&
461 elm->base.create_tid > node->mirror_tid) {
462 flags |= FLAG_BADMIRRORTID;
464 if (elm->base.delete_tid && node->mirror_tid &&
465 elm->base.delete_tid > node->mirror_tid) {
466 flags |= FLAG_BADMIRRORTID;
469 case HAMMER_BTREE_TYPE_RECORD:
470 if (left_bound == NULL || right_bound == NULL)
472 if (hammer_btree_cmp(&elm->base, left_bound) < 0)
473 flags |= FLAG_TOOFARLEFT;
474 if (hammer_btree_cmp(&elm->base, right_bound) >= 0)
475 flags |= FLAG_TOOFARRIGHT;
478 flags |= FLAG_BADTYPE;
483 flags |= FLAG_BADTYPE;
491 print_bigblock_fill(hammer_off_t offset)
493 struct hammer_blockmap_layer1 layer1;
494 struct hammer_blockmap_layer2 layer2;
498 blockmap_lookup(offset, &layer1, &layer2, &error);
499 printf("z%d:v%d:%lu:%lu:%lu=",
500 HAMMER_ZONE_DECODE(offset),
501 HAMMER_VOL_DECODE(offset),
502 HAMMER_BLOCKMAP_LAYER1_INDEX(offset),
503 HAMMER_BLOCKMAP_LAYER2_INDEX(offset),
504 offset & HAMMER_BIGBLOCK_MASK64);
507 printf("B%d", error);
509 fill = layer2.bytes_free * 100 / HAMMER_BIGBLOCK_SIZE;
511 printf("%d%%", fill);
516 * Check the generic crc on a data element. Inodes record types are
517 * special in that some of their fields are not CRCed.
519 * Also check that the zone is valid.
523 check_data_crc(hammer_btree_elm_t elm)
525 struct buffer_info *data_buffer;
526 hammer_off_t data_offset;
533 data_offset = elm->leaf.data_offset;
534 data_len = elm->leaf.data_len;
536 if (data_offset == 0 || data_len == 0)
542 blockmap_lookup(data_offset, NULL, NULL, &error);
546 ptr = get_buffer_data(data_offset, &data_buffer, 0);
547 len = HAMMER_BUFSIZE - ((int)data_offset & HAMMER_BUFMASK);
550 if (elm->leaf.base.rec_type == HAMMER_RECTYPE_INODE &&
551 data_len == sizeof(struct hammer_inode_data)) {
552 crc = crc32_ext(ptr, HAMMER_INODE_CRCSIZE, crc);
554 crc = crc32_ext(ptr, len, crc);
559 rel_buffer(data_buffer);
561 switch (error) { /* bad offset */
584 if (crc == elm->leaf.data_crc)
586 return("BX"); /* bad crc */
591 print_config(char *cfgtxt)
595 printf("\n%17stext=\"\n", "");
596 while((token = strsep(&cfgtxt, "\r\n")) != NULL) {
597 printf("%17s %s\n", "", token);
599 printf("%17s\"", "");
604 print_record(hammer_btree_elm_t elm)
606 struct buffer_info *data_buffer;
607 hammer_off_t data_offset;
609 hammer_data_ondisk_t data;
614 data_offset = elm->leaf.data_offset;
615 data_len = elm->leaf.data_len;
619 data = get_buffer_data(data_offset, &data_buffer, 0);
623 switch(elm->leaf.base.rec_type) {
624 case HAMMER_RECTYPE_UNKNOWN:
625 printf("\n%17s", "");
628 case HAMMER_RECTYPE_INODE:
629 printf("\n%17s", "");
630 printf("size=%jd nlinks=%jd",
631 (intmax_t)data->inode.size,
632 (intmax_t)data->inode.nlinks);
634 printf(" mode=%05o uflags=%08x\n",
638 printf("ctime=%016jx pobjid=%016jx obj_type=%d\n",
639 (uintmax_t)data->inode.ctime,
640 (uintmax_t)data->inode.parent_obj_id,
641 data->inode.obj_type);
643 printf("mtime=%016jx", (uintmax_t)data->inode.mtime);
644 printf(" caps=%02x", data->inode.cap_flags);
647 case HAMMER_RECTYPE_DIRENTRY:
648 printf("\n%17s", "");
649 data_len -= HAMMER_ENTRY_NAME_OFF;
650 printf("dir-entry ino=%016jx lo=%08x name=\"%*.*s\"",
651 (uintmax_t)data->entry.obj_id,
652 data->entry.localization,
653 data_len, data_len, data->entry.name);
655 case HAMMER_RECTYPE_FIX:
656 switch(elm->leaf.base.key) {
657 case HAMMER_FIXKEY_SYMLINK:
658 data_len -= HAMMER_SYMLINK_NAME_OFF;
659 printf("\n%17s", "");
660 printf("symlink=\"%*.*s\"", data_len, data_len,
667 case HAMMER_RECTYPE_PFS:
668 printf("\n%17s", "");
669 printf("sync_beg_tid=%016jx sync_end_tid=%016jx\n",
670 (intmax_t)data->pfsd.sync_beg_tid,
671 (intmax_t)data->pfsd.sync_end_tid);
672 uuid_to_string(&data->pfsd.shared_uuid, &str1, &status);
673 uuid_to_string(&data->pfsd.unique_uuid, &str2, &status);
675 printf("shared_uuid=%s\n", str1);
677 printf("unique_uuid=%s\n", str2);
679 printf("mirror_flags=%08x label=\"%s\"",
680 data->pfsd.mirror_flags, data->pfsd.label);
681 if (data->pfsd.snapshots[0])
682 printf(" snapshots=\"%s\"", data->pfsd.snapshots);
686 case HAMMER_RECTYPE_SNAPSHOT:
687 printf("\n%17s", "");
688 printf("tid=%016jx label=\"%s\"",
689 (intmax_t)data->snap.tid, data->snap.label);
691 case HAMMER_RECTYPE_CONFIG:
692 if (VerboseOpt > 2) {
693 print_config(data->config.text);
696 case HAMMER_RECTYPE_DATA:
697 if (VerboseOpt > 3) {
699 hexdump(data, data_len, "\t\t ", 0);
702 case HAMMER_RECTYPE_EXT:
703 case HAMMER_RECTYPE_DB:
704 if (VerboseOpt > 2) {
706 hexdump(data, data_len, "\t\t ", 0);
712 rel_buffer(data_buffer);
717 _strtoul(const char *p, int base)
719 unsigned long retval;
721 errno = 0; /* clear */
722 retval = strtoul(p, NULL, base);
723 if (errno == ERANGE && retval == ULONG_MAX)
730 _strtoull(const char *p, int base)
732 unsigned long long retval;
734 errno = 0; /* clear */
735 retval = strtoull(p, NULL, base);
736 if (errno == ERANGE && retval == ULLONG_MAX)
742 init_btree_search(const char *arg, int filter, btree_search_t search)
748 search->obj_id = (int64_t)HAMMER_MIN_OBJID;
749 search->rec_type = HAMMER_RECTYPE_LOWEST;
751 search->create_tid = 0;
753 search->filter = filter;
759 while ((p = s) != NULL) {
760 if ((s = strchr(s, ':')) != NULL)
763 search->lo = _strtoul(p, 16);
765 search->obj_id = _strtoull(p, 16);
767 search->rec_type = _strtoul(p, 16);
769 search->key = _strtoull(p, 16);
771 search->create_tid = _strtoull(p, 16);
781 test_btree_search(hammer_btree_elm_t elm, btree_search_t search)
783 hammer_base_elm_t base = &elm->base;
786 if (base->localization < search->lo)
788 if (base->localization > search->lo)
792 if (base->obj_id < search->obj_id)
794 if (base->obj_id > search->obj_id)
796 if (search->limit == 2)
797 return(0); /* ignore below */
799 if (base->rec_type < search->rec_type)
801 if (base->rec_type > search->rec_type)
803 if (search->limit == 3)
804 return(0); /* ignore below */
806 if (base->key < search->key)
808 if (base->key > search->key)
810 if (search->limit == 4)
811 return(0); /* ignore below */
813 if (base->create_tid == 0) {
814 if (search->create_tid == 0)
818 if (search->create_tid == 0)
820 if (base->create_tid < search->create_tid)
822 if (base->create_tid > search->create_tid)
831 hammer_cmd_show_undo(void)
833 struct volume_info *volume;
834 hammer_blockmap_t rootmap;
835 hammer_off_t scan_offset;
836 hammer_fifo_any_t head;
837 struct buffer_info *data_buffer = NULL;
840 volume = get_volume(RootVolNo);
841 rootmap = &volume->ondisk->vol0_blockmap[HAMMER_ZONE_UNDO_INDEX];
842 if (rootmap->first_offset <= rootmap->next_offset)
843 bytes = rootmap->next_offset - rootmap->first_offset;
845 bytes = rootmap->alloc_offset - rootmap->first_offset +
846 (rootmap->next_offset & HAMMER_OFF_LONG_MASK);
848 printf("Volume header UNDO %016jx-%016jx/%016jx\n",
849 (intmax_t)rootmap->first_offset,
850 (intmax_t)rootmap->next_offset,
851 (intmax_t)rootmap->alloc_offset);
852 printf("UNDO map is %jdMB\n",
853 (intmax_t)((rootmap->alloc_offset & HAMMER_OFF_LONG_MASK) /
855 printf("UNDO being used is %jdB\n", (intmax_t)bytes);
857 scan_offset = HAMMER_ZONE_ENCODE(HAMMER_ZONE_UNDO_INDEX, 0);
858 while (scan_offset < rootmap->alloc_offset) {
859 head = get_buffer_data(scan_offset, &data_buffer, 0);
860 printf("%016jx ", scan_offset);
862 switch(head->head.hdr_type) {
863 case HAMMER_HEAD_TYPE_PAD:
864 printf("PAD(%04x)", head->head.hdr_size);
866 case HAMMER_HEAD_TYPE_DUMMY:
867 printf("DUMMY(%04x) seq=%08x",
868 head->head.hdr_size, head->head.hdr_seq);
870 case HAMMER_HEAD_TYPE_UNDO:
871 printf("UNDO(%04x) seq=%08x "
872 "dataoff=%016jx bytes=%d",
873 head->head.hdr_size, head->head.hdr_seq,
874 (intmax_t)head->undo.undo_offset,
875 head->undo.undo_data_bytes);
877 case HAMMER_HEAD_TYPE_REDO:
878 printf("REDO(%04x) seq=%08x flags=%08x "
879 "objid=%016jx logoff=%016jx bytes=%d",
880 head->head.hdr_size, head->head.hdr_seq,
881 head->redo.redo_flags,
882 (intmax_t)head->redo.redo_objid,
883 (intmax_t)head->redo.redo_offset,
884 head->redo.redo_data_bytes);
887 printf("UNKNOWN(%04x,%04x) seq=%08x",
894 if (scan_offset == rootmap->first_offset)
896 if (scan_offset == rootmap->next_offset)
900 if ((head->head.hdr_size & HAMMER_HEAD_ALIGN_MASK) ||
901 head->head.hdr_size == 0 ||
902 head->head.hdr_size > HAMMER_UNDO_ALIGN -
903 ((u_int)scan_offset & HAMMER_UNDO_MASK)) {
904 printf("Illegal size field, skipping to "
906 scan_offset = (scan_offset + HAMMER_UNDO_MASK) &
909 scan_offset += head->head.hdr_size;
912 rel_buffer(data_buffer);