From 1477c82a1a4b44318c76d9c4c91fe197c00474cb Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sun, 7 Nov 2010 09:46:15 -0800 Subject: [PATCH] HAMMER - Add hammer dedup directive and support * Minor adjustments to fix compile errors on 64-bit systems (printf %lld -> %jd and use intmax_t casts). --- sbin/hammer/cmd_dedup.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/sbin/hammer/cmd_dedup.c b/sbin/hammer/cmd_dedup.c index 8dbdf85adf..6e8d21d746 100644 --- a/sbin/hammer/cmd_dedup.c +++ b/sbin/hammer/cmd_dedup.c @@ -707,8 +707,10 @@ dump_simulated_dedup(void) printf("=== Dumping simulated dedup entries:\n"); RB_FOREACH(sim_de, sim_dedup_entry_rb_tree, &sim_dedup_tree) { - printf("\tcrc=%08x cnt=%llu size=%llu\n", sim_de->crc, - sim_de->ref_blks, sim_de->ref_size); + printf("\tcrc=%08x cnt=%ju size=%ju\n", + sim_de->crc, + (intmax_t)sim_de->ref_blks, + (intmax_t)sim_de->ref_size); } printf("end of dump ===\n"); } @@ -726,19 +728,20 @@ dump_real_dedup(void) printf("\tcrc=%08x fictious\n", de->leaf.data_crc); RB_FOREACH(sha_de, sha_dedup_entry_rb_tree, &de->u.fict_root) { - printf("\t\tcrc=%08x cnt=%llu size=%llu\n\t\t\tsha=", - sha_de->leaf.data_crc, - sha_de->ref_blks, - sha_de->ref_size); + printf("\t\tcrc=%08x cnt=%ju size=%ju\n\t" + "\t\tsha=", + sha_de->leaf.data_crc, + (intmax_t)sha_de->ref_blks, + (intmax_t)sha_de->ref_size); for (i = 0; i < SHA256_DIGEST_LENGTH; ++i) printf("%02x", sha_de->sha_hash[i]); printf("\n"); } } else { - printf("\tcrc=%08x cnt=%llu size=%llu\n", - de->leaf.data_crc, - de->u.de.ref_blks, - de->u.de.ref_size); + printf("\tcrc=%08x cnt=%ju size=%ju\n", + de->leaf.data_crc, + (intmax_t)de->u.de.ref_blks, + (intmax_t)de->u.de.ref_size); } } printf("end of dump ===\n"); -- 2.11.4.GIT