$(E) " MK_CMDS $@"
$(Q) DIR=$(srcdir) $(MK_CMDS) $(srcdir)/tst_bitmaps_cmd.ct
-tst_bitmaps: tst_bitmaps.o tst_bitmaps_cmd.o $(STATIC_LIBEXT2FS) \
- $(DEPSTATIC_LIBSS) $(DEPSTATIC_LIBCOM_ERR)
+tst_bitmaps: tst_bitmaps.o tst_bitmaps_cmd.o $(srcdir)/blkmap64_rb.c \
+ $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBSS) $(DEPSTATIC_LIBCOM_ERR)
$(E) " LD $@"
- $(Q) $(CC) -o $@ tst_bitmaps.o tst_bitmaps_cmd.o $(ALL_CFLAGS) \
+ $(Q) $(CC) -o $@ tst_bitmaps.o tst_bitmaps_cmd.o \
+ -DDEBUG_RB $(srcdir)/blkmap64_rb.c $(ALL_CFLAGS) \
$(STATIC_LIBEXT2FS) $(STATIC_LIBSS) $(STATIC_LIBCOM_ERR) \
$(SYSLIBS)
}
#else
#define check_tree(root, msg) do {} while (0)
-#define print_tree(root, msg) do {} while (0)
+#define print_tree(root) do {} while (0)
#endif
static void rb_get_new_extent(struct bmap_rb_extent **ext, __u64 start,
static int rb_mark_bmap(ext2fs_generic_bitmap bitmap, __u64 arg)
{
struct ext2fs_rb_private *bp;
+ int retval;
bp = (struct ext2fs_rb_private *) bitmap->private;
arg -= bitmap->start;
- return rb_insert_extent(arg, 1, bp);
+ retval = rb_insert_extent(arg, 1, bp);
+ check_tree(&bp->root, __func__);
+ return retval;
}
static int rb_unmark_bmap(ext2fs_generic_bitmap bitmap, __u64 arg)
arg -= bitmap->start;
rb_insert_extent(arg, num, bp);
+ check_tree(&bp->root, __func__);
}
static void rb_unmark_bmap_extent(ext2fs_generic_bitmap bitmap, __u64 arg,
rb_insert_extent(start + first_set - bitmap->start,
i - first_set, bp);
+ check_tree(&bp->root, __func__);
first_set = -1;
}
- if (first_set != -1)
+ if (first_set != -1) {
rb_insert_extent(start + first_set - bitmap->start,
num - first_set, bp);
+ check_tree(&bp->root, __func__);
+ }
return 0;
}
bp->rcursor = NULL;
bp->rcursor_next = NULL;
bp->wcursor = NULL;
+ check_tree(&bp->root, __func__);
}
#ifdef BMAP_STATS