HAMMER - Add hammer dedup directive and support
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 7 Nov 2010 17:46:15 +0000 (09:46 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 18 Nov 2010 17:42:51 +0000 (09:42 -0800)
* Minor adjustments to fix compile errors on 64-bit systems
  (printf %lld -> %jd and use intmax_t casts).

sbin/hammer/cmd_dedup.c

index 8dbdf85..6e8d21d 100644 (file)
@@ -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");