sbin/hammer2: Print bcount(>0) for all blockrefs in "show"/"freemap"
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Wed, 14 Aug 2019 15:50:43 +0000 (00:50 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Thu, 15 Aug 2019 15:37:40 +0000 (00:37 +0900)
sbin/hammer2/cmd_debug.c

index a362895..324b1eb 100644 (file)
@@ -566,6 +566,8 @@ show_bref(hammer2_volume_data_t *voldata, int fd, int tab,
                  (intmax_t)bref->mirror_tid, (intmax_t)bref->modify_tid,
                  bref->leaf_count);
        tab += show_tab;
+       if (bcount)
+               printf("bcnt=%d ", bcount);
        if (bref->flags)
                printf("flags=%02x ", bref->flags);
        if (bref->type == HAMMER2_BREF_TYPE_FREEMAP_NODE ||
@@ -756,7 +758,6 @@ show_bref(hammer2_volume_data_t *voldata, int fd, int tab,
                break;
        case HAMMER2_BREF_TYPE_INDIRECT:
                printf("{\n");
-               tabprintf(tab, "count %d\n", bcount);
                break;
        case HAMMER2_BREF_TYPE_DATA:
                printf("\n");
@@ -806,7 +807,6 @@ show_bref(hammer2_volume_data_t *voldata, int fd, int tab,
                break;
        case HAMMER2_BREF_TYPE_FREEMAP_NODE:
                printf("{\n");
-               tabprintf(tab, "count %d\n", bcount);
                break;
        default:
                printf("\n");