sys/vfs/hammer: Use "%016jx",intmax_t
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Tue, 22 Mar 2016 16:22:34 +0000 (01:22 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 27 Mar 2016 15:43:22 +0000 (00:43 +0900)
Some kprintf use long long, others use intmax_t
for HAMMER offsets and B-Tree keys in hexadecimal.
Make them all use intmax_t.

16 files changed:
sbin/hammer/ondisk.c
sys/vfs/hammer/hammer_blockmap.c
sys/vfs/hammer/hammer_btree.c
sys/vfs/hammer/hammer_cursor.c
sys/vfs/hammer/hammer_inode.c
sys/vfs/hammer/hammer_io.c
sys/vfs/hammer/hammer_object.c
sys/vfs/hammer/hammer_ondisk.c
sys/vfs/hammer/hammer_prune.c
sys/vfs/hammer/hammer_rebalance.c
sys/vfs/hammer/hammer_reblock.c
sys/vfs/hammer/hammer_redo.c
sys/vfs/hammer/hammer_subs.c
sys/vfs/hammer/hammer_transaction.c
sys/vfs/hammer/hammer_undo.c
sys/vfs/hammer/hammer_vnops.c

index 5595981..6934c4b 100644 (file)
@@ -307,8 +307,8 @@ get_buffer(hammer_off_t buf_offset, int isnew)
                buf = malloc(sizeof(*buf));
                bzero(buf, sizeof(*buf));
                if (DebugOpt > 1) {
-                       fprintf(stderr, "get_buffer: %016llx %016llx at %p\n",
-                               (long long)orig_offset, (long long)buf_offset,
+                       fprintf(stderr, "get_buffer: %016jx %016jx at %p\n",
+                               (intmax_t)orig_offset, (intmax_t)buf_offset,
                                buf);
                }
                buf->buf_offset = buf_offset;
@@ -323,8 +323,8 @@ get_buffer(hammer_off_t buf_offset, int isnew)
                dora = (isnew == 0);
        } else {
                if (DebugOpt > 1) {
-                       fprintf(stderr, "get_buffer: %016llx %016llx at %p *\n",
-                               (long long)orig_offset, (long long)buf_offset,
+                       fprintf(stderr, "get_buffer: %016jx %016jx at %p *\n",
+                               (intmax_t)orig_offset, (intmax_t)buf_offset,
                                buf);
                }
                hammer_cache_used(&buf->cache);
@@ -338,11 +338,11 @@ get_buffer(hammer_off_t buf_offset, int isnew)
                        n = readhammerbuf(volume, ondisk, buf->raw_offset);
                        if (n == -1) {
                                if (AssertOnFailure)
-                                       err(1, "get_buffer: %s:%016llx "
-                                           "Read failed at offset %016llx",
+                                       err(1, "get_buffer: %s:%016jx "
+                                           "Read failed at offset %016jx",
                                            volume->name,
-                                           (long long)buf->buf_offset,
-                                           (long long)buf->raw_offset);
+                                           (intmax_t)buf->buf_offset,
+                                           (intmax_t)buf->raw_offset);
                                bzero(ondisk, HAMMER_BUFSIZE);
                        }
                }
index aa9dff5..4d71b88 100644 (file)
@@ -1400,7 +1400,7 @@ failed:
                hammer_rel_buffer(buffer, 0);
        hammer_rel_volume(root_volume, 0);
        if (hammer_debug_general & 0x4000) {
-               hdkprintf("%016llx -> %d\n", (long long)zone_offset, bytes);
+               hdkprintf("%016jx -> %d\n", (intmax_t)zone_offset, bytes);
        }
        return(bytes);
 }
@@ -1487,8 +1487,8 @@ failed:
                hammer_rel_buffer(buffer, 0);
        hammer_rel_volume(root_volume, 0);
        if (hammer_debug_general & 0x0800) {
-               hdkprintf("%016llx -> %016llx\n",
-                       (long long)zone_offset, (long long)result_offset);
+               hdkprintf("%016jx -> %016jx\n",
+                       (intmax_t)zone_offset, (intmax_t)result_offset);
        }
        return(result_offset);
 }
index 7361736..8832091 100644 (file)
@@ -174,10 +174,10 @@ hammer_btree_iterate(hammer_cursor_t cursor)
 
                if (cursor->index == node->count) {
                        if (hammer_debug_btree) {
-                               hkprintf("BRACKETU %016llx[%d] -> %016llx[%d] td=%p\n",
-                                       (long long)cursor->node->node_offset,
+                               hkprintf("BRACKETU %016jx[%d] -> %016jx[%d] td=%p\n",
+                                       (intmax_t)cursor->node->node_offset,
                                        cursor->index,
-                                       (long long)(cursor->parent ? cursor->parent->node_offset : -1),
+                                       (intmax_t)(cursor->parent ? cursor->parent->node_offset : -1),
                                        cursor->parent_index,
                                        curthread);
                        }
@@ -606,8 +606,8 @@ hammer_btree_lookup(hammer_cursor_t cursor)
                                break;
                        }
                        if (hammer_debug_btree) {
-                               hkprintf("CREATE_CHECK %016llx\n",
-                                       (long long)cursor->create_check);
+                               hkprintf("CREATE_CHECK %016jx\n",
+                                       (intmax_t)cursor->create_check);
                        }
                        cursor->key_beg.create_tid = cursor->create_check;
                        /* loop */
@@ -764,8 +764,8 @@ hammer_btree_extract(hammer_cursor_t cursor, int flags)
         */
        if (error == 0 &&
            hammer_crc_test_leaf(cursor->data, &elm->leaf) == 0) {
-               hdkprintf("CRC DATA @ %016llx/%d FAILED\n",
-                       (long long)elm->leaf.data_offset, elm->leaf.data_len);
+               hdkprintf("CRC DATA @ %016jx/%d FAILED\n",
+                       (intmax_t)elm->leaf.data_offset, elm->leaf.data_len);
                if (hammer_debug_critical)
                        Debugger("CRC FAILED: DATA");
                if (cursor->trans->flags & HAMMER_TRANSF_CRCDOM)
@@ -1078,8 +1078,8 @@ btree_search(hammer_cursor_t cursor, int flags)
                 */
                ++hammer_stats_btree_iterations;
                if (hammer_debug_btree) {
-                       hkprintf("SEARCH-I %016llx count=%d\n",
-                               (long long)cursor->node->node_offset,
+                       hkprintf("SEARCH-I %016jx count=%d\n",
+                               (intmax_t)cursor->node->node_offset,
                                node->count);
                }
 
@@ -1278,8 +1278,8 @@ btree_search(hammer_cursor_t cursor, int flags)
        KKASSERT (node->type == HAMMER_BTREE_TYPE_LEAF);
        KKASSERT(node->count <= HAMMER_BTREE_LEAF_ELMS);
        if (hammer_debug_btree) {
-               hkprintf("SEARCH-L %016llx count=%d\n",
-                       (long long)cursor->node->node_offset,
+               hkprintf("SEARCH-L %016jx count=%d\n",
+                       (intmax_t)cursor->node->node_offset,
                        node->count);
        }
 
@@ -1332,8 +1332,8 @@ btree_search(hammer_cursor_t cursor, int flags)
                cursor->index = i;
                error = 0;
                if (hammer_debug_btree) {
-                       hkprintf("RESULT-L %016llx[%d] (SUCCESS)\n",
-                               (long long)cursor->node->node_offset, i);
+                       hkprintf("RESULT-L %016jx[%d] (SUCCESS)\n",
+                               (intmax_t)cursor->node->node_offset, i);
                }
                goto done;
        }
@@ -1343,8 +1343,8 @@ btree_search(hammer_cursor_t cursor, int flags)
         */
 failed:
        if (hammer_debug_btree) {
-               hkprintf("RESULT-L %016llx[%d] (FAILED)\n",
-                       (long long)cursor->node->node_offset, i);
+               hkprintf("RESULT-L %016jx[%d] (FAILED)\n",
+                       (intmax_t)cursor->node->node_offset, i);
        }
 
        /*
@@ -2433,9 +2433,9 @@ hammer_btree_mirror_propagate(hammer_cursor_t cursor, hammer_tid_t mirror_tid)
                elm->mirror_tid = mirror_tid;
                hammer_modify_node_done(node);
                if (hammer_debug_general & 0x0002) {
-                       hdkprintf("propagate %016llx @%016llx:%d\n",
-                               (long long)mirror_tid,
-                               (long long)node->node_offset,
+                       hdkprintf("propagate %016jx @%016jx:%d\n",
+                               (intmax_t)mirror_tid,
+                               (intmax_t)node->node_offset,
                                cursor->index);
                }
 
@@ -2449,9 +2449,9 @@ hammer_btree_mirror_propagate(hammer_cursor_t cursor, hammer_tid_t mirror_tid)
                node->ondisk->mirror_tid = mirror_tid;
                hammer_modify_node_done(node);
                if (hammer_debug_general & 0x0002) {
-                       hdkprintf("propagate %016llx @%016llx\n",
-                               (long long)mirror_tid,
-                               (long long)node->node_offset);
+                       hdkprintf("propagate %016jx @%016jx\n",
+                               (intmax_t)mirror_tid,
+                               (intmax_t)node->node_offset);
                }
        }
        if (error == ENOENT)
@@ -2964,9 +2964,9 @@ hammer_print_btree_node(hammer_node_ondisk_t ondisk)
 {
        int i, n;
 
-       kprintf("node %p count=%d parent=%016llx type=%c\n",
+       kprintf("node %p count=%d parent=%016jx type=%c\n",
                ondisk, ondisk->count,
-               (long long)ondisk->parent, ondisk->type);
+               (intmax_t)ondisk->parent, ondisk->type);
 
        switch (ondisk->type) {
        case HAMMER_BTREE_TYPE_INTERNAL:
@@ -2991,10 +2991,10 @@ hammer_print_btree_node(hammer_node_ondisk_t ondisk)
 void
 hammer_print_btree_elm(hammer_btree_elm_t elm)
 {
-       kprintf("\tobj_id       = %016llx\n", (long long)elm->base.obj_id);
-       kprintf("\tkey          = %016llx\n", (long long)elm->base.key);
-       kprintf("\tcreate_tid   = %016llx\n", (long long)elm->base.create_tid);
-       kprintf("\tdelete_tid   = %016llx\n", (long long)elm->base.delete_tid);
+       kprintf("\tobj_id       = %016jx\n", (intmax_t)elm->base.obj_id);
+       kprintf("\tkey          = %016jx\n", (intmax_t)elm->base.key);
+       kprintf("\tcreate_tid   = %016jx\n", (intmax_t)elm->base.create_tid);
+       kprintf("\tdelete_tid   = %016jx\n", (intmax_t)elm->base.delete_tid);
        kprintf("\trec_type     = %04x\n", elm->base.rec_type);
        kprintf("\tobj_type     = %02x\n", elm->base.obj_type);
        kprintf("\tbtype        = %02x (%c)\n", elm->base.btype,
@@ -3002,11 +3002,11 @@ hammer_print_btree_elm(hammer_btree_elm_t elm)
        kprintf("\tlocalization = %08x\n", elm->base.localization);
 
        if (hammer_is_internal_node_elm(elm)) {
-               kprintf("\tsubtree_off  = %016llx\n",
-                       (long long)elm->internal.subtree_offset);
+               kprintf("\tsubtree_off  = %016jx\n",
+                       (intmax_t)elm->internal.subtree_offset);
        } else if (hammer_is_leaf_node_elm(elm)) {
-               kprintf("\tdata_offset  = %016llx\n",
-                       (long long)elm->leaf.data_offset);
+               kprintf("\tdata_offset  = %016jx\n",
+                       (intmax_t)elm->leaf.data_offset);
                kprintf("\tdata_len     = %08x\n", elm->leaf.data_len);
                kprintf("\tdata_crc     = %08x\n", elm->leaf.data_crc);
        }
@@ -3017,18 +3017,18 @@ void
 hammer_debug_btree_elm(hammer_cursor_t cursor, hammer_btree_elm_t elm,
                const char *s, int res)
 {
-       hkprintf("%-8s %016llx[%02d] %c "
-               "lo=%08x obj=%016llx rec=%02x key=%016llx tid=%016llx td=%p "
+       hkprintf("%-8s %016jx[%02d] %c "
+               "lo=%08x obj=%016jx rec=%02x key=%016jx tid=%016jx td=%p "
                "r=%d\n",
                s,
-               (long long)cursor->node->node_offset,
+               (intmax_t)cursor->node->node_offset,
                cursor->index,
                hammer_elm_btype(elm),
                elm->base.localization,
-               (long long)elm->base.obj_id,
+               (intmax_t)elm->base.obj_id,
                elm->base.rec_type,
-               (long long)elm->base.key,
-               (long long)elm->base.create_tid,
+               (intmax_t)elm->base.key,
+               (intmax_t)elm->base.create_tid,
                curthread,
                res);
 }
@@ -3040,16 +3040,16 @@ hammer_debug_btree_parent(hammer_cursor_t cursor, const char *s)
        hammer_btree_elm_t elm =
            &cursor->parent->ondisk->elms[cursor->parent_index];
 
-       hkprintf("%-8s %016llx[%d] %c "
-               "(%016llx/%016llx %016llx/%016llx) (%p/%p %p/%p)\n",
+       hkprintf("%-8s %016jx[%d] %c "
+               "(%016jx/%016jx %016jx/%016jx) (%p/%p %p/%p)\n",
                s,
-               (long long)cursor->parent->node_offset,
+               (intmax_t)cursor->parent->node_offset,
                cursor->parent_index,
                hammer_elm_btype(elm),
-               (long long)cursor->left_bound->obj_id,
-               (long long)elm->internal.base.obj_id,
-               (long long)cursor->right_bound->obj_id,
-               (long long)(elm + 1)->internal.base.obj_id,
+               (intmax_t)cursor->left_bound->obj_id,
+               (intmax_t)elm->internal.base.obj_id,
+               (intmax_t)cursor->right_bound->obj_id,
+               (intmax_t)(elm + 1)->internal.base.obj_id,
                cursor->left_bound,
                elm,
                cursor->right_bound,
index bf06aa7..c8537cb 100644 (file)
@@ -652,10 +652,10 @@ hammer_cursor_down(hammer_cursor_t cursor)
                        ("BTYPE MISMATCH %c %c NODE %p",
                         elm->base.btype, node->ondisk->type, node));
                if (node->ondisk->parent != cursor->parent->node_offset)
-                       hpanic("node %p %016llx vs %016llx",
+                       hpanic("node %p %016jx vs %016jx",
                                node,
-                               (long long)node->ondisk->parent,
-                               (long long)cursor->parent->node_offset);
+                               (intmax_t)node->ondisk->parent,
+                               (intmax_t)cursor->parent->node_offset);
                KKASSERT(node->ondisk->parent == cursor->parent->node_offset);
        }
 
index f63d29e..71eb287 100644 (file)
@@ -927,7 +927,7 @@ hammer_create_inode(hammer_transaction_t trans, struct vattr *vap,
                hammer_free_inode(ip);
                ip = NULL;
        } else if (RB_INSERT(hammer_ino_rb_tree, &hmp->rb_inos_root, ip)) {
-               hpanic("duplicate obj_id %llx", (long long)ip->obj_id);
+               hpanic("duplicate obj_id %jx", (intmax_t)ip->obj_id);
                /* not reached */
                hammer_free_inode(ip);
        }
@@ -1884,8 +1884,8 @@ hammer_setup_parent_inodes(hammer_inode_t ip, int depth,
                if (hammer_debug_general & 0x10000)
                        hkrateprintf(&hammer_gen_krate,
                            "Warning: depth limit reached on "
-                           "setup recursion, inode %p %016llx\n",
-                           ip, (long long)ip->obj_id);
+                           "setup recursion, inode %p %016jx\n",
+                           ip, (intmax_t)ip->obj_id);
                return(-2);
        }
 
index 4d32a24..774f0db 100644 (file)
@@ -1452,7 +1452,7 @@ hammer_io_direct_read(hammer_mount_t hmp, struct bio *bio,
        hammer_rel_volume(volume, 0);
 done:
        if (error) {
-               hdkprintf("failed @ %016llx\n", (long long)zone2_offset);
+               hdkprintf("failed @ %016jx\n", (intmax_t)zone2_offset);
                bp->b_error = error;
                bp->b_flags |= B_ERROR;
                biodone(bio);
@@ -1532,7 +1532,7 @@ hammer_io_indirect_read(hammer_mount_t hmp, struct bio *bio,
        hammer_rel_volume(volume, 0);
 done:
        if (error) {
-               hdkprintf("failed @ %016llx\n", (long long)zone2_offset);
+               hdkprintf("failed @ %016jx\n", (intmax_t)zone2_offset);
                bp->b_error = error;
                bp->b_flags |= B_ERROR;
                biodone(bio);
@@ -1705,7 +1705,7 @@ hammer_io_direct_write(hammer_mount_t hmp, struct bio *bio,
                 * never added to the tree so we do not have to worry
                 * about the backend.
                 */
-               hdkprintf("failed @ %016llx\n", (long long)leaf->data_offset);
+               hdkprintf("failed @ %016jx\n", (intmax_t)leaf->data_offset);
                bp = bio->bio_buf;
                bp->b_resid = 0;
                bp->b_error = EIO;
index 32595f8..49db19f 100644 (file)
@@ -1254,8 +1254,8 @@ hammer_ip_sync_record_cursor(hammer_cursor_t cursor, hammer_record_t record)
        if (hammer_debug_inode)
                hdkprintf("DOINSERT LOOKUP %d\n", error);
        if (error == 0) {
-               hdkprintf("duplicate rec at (%016llx)\n",
-                       (long long)record->leaf.base.key);
+               hdkprintf("duplicate rec at (%016jx)\n",
+                       (intmax_t)record->leaf.base.key);
                if (hammer_debug_critical)
                        Debugger("duplicate record1");
                error = EIO;
@@ -1312,11 +1312,11 @@ hammer_ip_sync_record_cursor(hammer_cursor_t cursor, hammer_record_t record)
 
        error = hammer_btree_insert(cursor, &record->leaf, &doprop);
        if (hammer_debug_inode && error) {
-               hdkprintf("BTREE INSERT error %d @ %016llx:%d key %016llx\n",
+               hdkprintf("BTREE INSERT error %d @ %016jx:%d key %016jx\n",
                        error,
-                       (long long)cursor->node->node_offset,
+                       (intmax_t)cursor->node->node_offset,
                        cursor->index,
-                       (long long)record->leaf.base.key);
+                       (intmax_t)record->leaf.base.key);
        }
 
        /*
@@ -1474,9 +1474,9 @@ _hammer_ip_seek_btree(hammer_cursor_t cursor)
                error = hammer_btree_lookup(cursor);
                if (error == ENOENT || error == EDEADLK) {
                        if (hammer_debug_general & 0x2000) {
-                               hdkprintf("error %d node %p %016llx index %d\n",
+                               hdkprintf("error %d node %p %016jx index %d\n",
                                        error, cursor->node,
-                                       (long long)cursor->node->node_offset,
+                                       (intmax_t)cursor->node->node_offset,
                                        cursor->index);
                        }
                        cursor->flags &= ~HAMMER_CURSOR_ATEDISK;
@@ -1517,8 +1517,8 @@ _hammer_ip_reseek(hammer_cursor_t cursor)
        /*
         * Do the re-seek.
         */
-       hkprintf("Debug: re-seeked during scan @ino=%016llx\n",
-               (long long)cursor->ip->obj_id);
+       hkprintf("Debug: re-seeked during scan @ino=%016jx\n",
+               (intmax_t)cursor->ip->obj_id);
        save = cursor->key_beg;
        cursor->key_beg = cursor->iprec->leaf.base;
        error = _hammer_ip_seek_btree(cursor);
@@ -1669,8 +1669,8 @@ again:
         */
        while (cursor->rec_generation != cursor->ip->rec_generation &&
               error == 0) {
-               hkprintf("Debug: generation changed during scan @ino=%016llx\n",
-                       (long long)cursor->ip->obj_id);
+               hkprintf("Debug: generation changed during scan @ino=%016jx\n",
+                       (intmax_t)cursor->ip->obj_id);
                cursor->rec_generation = cursor->ip->rec_generation;
                if (cursor->flags & HAMMER_CURSOR_MEMEOF)
                        break;
@@ -2019,8 +2019,8 @@ retry:
                         * split existing records.
                         */
                        if (off < ran_beg && leaf->base.key > ran_beg) {
-                               hpanic("hammer left edge case %016llx %d",
-                                       (long long)leaf->base.key,
+                               hpanic("hammer left edge case %016jx %d",
+                                       (intmax_t)leaf->base.key,
                                        leaf->data_len);
                        }
 
@@ -2334,8 +2334,8 @@ hammer_create_at_cursor(hammer_cursor_t cursor, hammer_btree_leaf_elm_t leaf,
                        error = copyin(udata, ndata, leaf->data_len);
                        if (error == 0) {
                                if (hammer_crc_test_leaf(ndata, leaf) == 0) {
-                                       hdkprintf("CRC DATA @ %016llx/%d MISMATCH ON PIPE\n",
-                                               (long long)ndata_offset,
+                                       hdkprintf("CRC DATA @ %016jx/%d MISMATCH ON PIPE\n",
+                                               (intmax_t)ndata_offset,
                                                leaf->data_len);
                                        error = EINVAL;
                                } else {
@@ -2497,9 +2497,9 @@ hammer_delete_at_cursor(hammer_cursor_t cursor, int delete_flags,
                        hammer_modify_node_done(node);
                        doprop = 1;
                        if (hammer_debug_general & 0x0002) {
-                               hdkprintf("propagate %016llx @%016llx\n",
-                                       (long long)elm->leaf.base.delete_tid,
-                                       (long long)node->node_offset);
+                               hdkprintf("propagate %016jx @%016jx\n",
+                                       (intmax_t)elm->leaf.base.delete_tid,
+                                       (intmax_t)node->node_offset);
                        }
                }
 
index dbbcca6..ed9a6fe 100644 (file)
@@ -877,9 +877,9 @@ hammer_del_buffers(hammer_mount_t hmp, hammer_off_t base_offset,
                            (hammer_debug_general & 0x8000)) {
                                krateprintf(&hmp->kdiag,
                                        "hammer_del_buffers: unable to "
-                                       "invalidate %016llx buffer=%p "
+                                       "invalidate %016jx buffer=%p "
                                        "rep=%d lkrefs=%08x\n",
-                                       (long long)base_offset,
+                                       (intmax_t)base_offset,
                                        buffer, report_conflicts,
                                        (buffer ? buffer->io.lock.refs : -1));
                        }
@@ -911,9 +911,9 @@ hammer_load_buffer(hammer_buffer_t buffer, int isnew)
        volume = buffer->io.volume;
 
        if (hammer_debug_io & 0x0004) {
-               hdkprintf("load_buffer %016llx %016llx isnew=%d od=%p\n",
-                       (long long)buffer->zoneX_offset,
-                       (long long)buffer->zone2_offset,
+               hdkprintf("load_buffer %016jx %016jx isnew=%d od=%p\n",
+                       (intmax_t)buffer->zoneX_offset,
+                       (intmax_t)buffer->zone2_offset,
                        isnew, buffer->ondisk);
        }
 
@@ -1336,8 +1336,8 @@ hammer_load_node(hammer_transaction_t trans, hammer_node_t node, int isnew)
                if (isnew == 0 &&
                    (node->flags & HAMMER_NODE_CRCANY) == 0) {
                        if (hammer_crc_test_btree(node->ondisk) == 0) {
-                               hdkprintf("CRC B-TREE NODE @ %016llx/%lu FAILED\n",
-                                       (long long)node->node_offset,
+                               hdkprintf("CRC B-TREE NODE @ %016jx/%lu FAILED\n",
+                                       (intmax_t)node->node_offset,
                                        sizeof(*node->ondisk));
                                if (hammer_debug_critical)
                                        Debugger("CRC FAILED: B-TREE NODE");
index 223ba76..ec61213 100644 (file)
@@ -163,18 +163,18 @@ retry:
                        prune->stat_oldest_tid = elm->base.create_tid;
 
                if (hammer_debug_general & 0x0200) {
-                       hdkprintf("check %016llx %016llx cre=%016llx del=%016llx\n",
-                                       (long long)elm->base.obj_id,
-                                       (long long)elm->base.key,
-                                       (long long)elm->base.create_tid,
-                                       (long long)elm->base.delete_tid);
+                       hdkprintf("check %016jx %016jx cre=%016jx del=%016jx\n",
+                                       (intmax_t)elm->base.obj_id,
+                                       (intmax_t)elm->base.key,
+                                       (intmax_t)elm->base.create_tid,
+                                       (intmax_t)elm->base.delete_tid);
                }
 
                if (prune_should_delete(prune, elm)) {
                        if (hammer_debug_general & 0x0200) {
-                               hdkprintf("check %016llx %016llx: DELETE\n",
-                                       (long long)elm->base.obj_id,
-                                       (long long)elm->base.key);
+                               hdkprintf("check %016jx %016jx: DELETE\n",
+                                       (intmax_t)elm->base.obj_id,
+                                       (intmax_t)elm->base.key);
                        }
 
                        /*
@@ -219,9 +219,9 @@ retry:
                        prune_check_nlinks(&cursor, elm);
                        cursor.flags |= HAMMER_CURSOR_ATEDISK;
                        if (hammer_debug_general & 0x0100) {
-                               hdkprintf("check %016llx %016llx: SKIP\n",
-                                       (long long)elm->base.obj_id,
-                                       (long long)elm->base.key);
+                               hdkprintf("check %016jx %016jx: SKIP\n",
+                                       (intmax_t)elm->base.obj_id,
+                                       (intmax_t)elm->base.key);
                        }
                }
                ++prune->stat_scanrecords;
@@ -330,14 +330,14 @@ prune_check_nlinks(hammer_cursor_t cursor, hammer_btree_leaf_elm_t elm)
                      0, &error);
        if (ip) {
                if (hammer_debug_general & 0x0001) {
-                       hdkprintf("pruning disconnected inode %016llx\n",
-                               (long long)elm->base.obj_id);
+                       hdkprintf("pruning disconnected inode %016jx\n",
+                               (intmax_t)elm->base.obj_id);
                }
                hammer_rel_inode(ip, 0);
                hammer_inode_waitreclaims(cursor->trans);
        } else {
-               hkprintf("unable to prune disconnected inode %016llx\n",
-                       (long long)elm->base.obj_id);
+               hkprintf("unable to prune disconnected inode %016jx\n",
+                       (intmax_t)elm->base.obj_id);
        }
 }
 
index c6f6f38..dcdbd5f 100644 (file)
@@ -528,7 +528,7 @@ rebalance_closeout(hammer_node_lock_t base_item, int base_count,
         * degenerate leaf case.
         */
        if (hammer_debug_general & 0x1000) {
-               hdkprintf("%016llx:", (long long)base_item->node->node_offset);
+               hdkprintf("%016jx:", (intmax_t)base_item->node->node_offset);
        }
        if (base_item->copy->count != base_count) {
                base_item->flags |= HAMMER_NODE_LOCK_UPDATED;
index 4f8c8d5..e6c9c8e 100644 (file)
@@ -485,10 +485,10 @@ hammer_reblock_data(struct hammer_ioc_reblock *reblock,
        hammer_modify_node_done(cursor->node);
 
        if (hammer_debug_general & 0x4000) {
-               hdkprintf("%08x %016llx -> %016llx\n",
+               hdkprintf("%08x %016jx -> %016jx\n",
                        (elm ? elm->base.localization : -1),
-                       (long long)odata_offset,
-                       (long long)ndata_offset);
+                       (intmax_t)odata_offset,
+                       (intmax_t)ndata_offset);
        }
 done:
        if (data_buffer)
@@ -535,10 +535,10 @@ hammer_reblock_leaf_node(struct hammer_ioc_reblock *reblock,
        hammer_delete_node(cursor->trans, onode);
 
        if (hammer_debug_general & 0x4000) {
-               hdkprintf("%08x %016llx -> %016llx\n",
+               hdkprintf("%08x %016jx -> %016jx\n",
                        (elm ? elm->base.localization : -1),
-                       (long long)onode->node_offset,
-                       (long long)nnode->node_offset);
+                       (intmax_t)onode->node_offset,
+                       (intmax_t)nnode->node_offset);
        }
        hammer_modify_node_done(nnode);
        cursor->node = nnode;
@@ -595,10 +595,10 @@ hammer_reblock_int_node(struct hammer_ioc_reblock *reblock,
        hammer_delete_node(cursor->trans, onode);
 
        if (hammer_debug_general & 0x4000) {
-               hdkprintf("%08x %016llx -> %016llx\n",
+               hdkprintf("%08x %016jx -> %016jx\n",
                        (elm ? elm->base.localization : -1),
-                       (long long)onode->node_offset,
-                       (long long)nnode->node_offset);
+                       (intmax_t)onode->node_offset,
+                       (intmax_t)nnode->node_offset);
        }
        hammer_modify_node_done(nnode);
        cursor->node = nnode;
index 9a761f3..16b376a 100644 (file)
@@ -207,8 +207,8 @@ hammer_generate_redo(hammer_transaction_t trans, hammer_inode_t ip,
                        (int)sizeof(struct hammer_fifo_redo) +
                        (int)sizeof(struct hammer_fifo_tail);
                if (hammer_debug_general & 0x0080) {
-                       hdkprintf("redo %016llx %d %d\n",
-                               (long long)next_offset, bytes, n);
+                       hdkprintf("redo %016jx %d %d\n",
+                               (intmax_t)next_offset, bytes, n);
                }
 
                redo->head.hdr_signature = HAMMER_HEAD_SIGNATURE;
index b53c9c3..cac86cb 100644 (file)
@@ -1018,8 +1018,8 @@ hammer_direntry_namekey(hammer_inode_t dip, const void *name, int len,
                if ((key & 0xFFFFFFFF00000000LL) == 0)
                        key |= 0x100000000LL;
                if (hammer_debug_general & 0x0400) {
-                       hdkprintf("0x%016llx %*.*s\n",
-                               (long long)key, len, len, aname);
+                       hdkprintf("0x%016jx %*.*s\n",
+                               (intmax_t)key, len, len, aname);
                }
                *max_iterationsp = 0x00FFFFFF;
                break;
@@ -1213,8 +1213,8 @@ hammer_blockdemarc(int64_t file_offset1, int64_t file_offset2)
                        return(file_offset2);
                return(HAMMER_XDEMARC);
        }
-       hpanic("illegal range %lld %lld",
-             (long long)file_offset1, (long long)file_offset2);
+       hpanic("illegal range %jd %jd",
+             (intmax_t)file_offset1, (intmax_t)file_offset2);
 }
 
 udev_t
index 0604e72..6e560cc 100644 (file)
@@ -175,7 +175,7 @@ hammer_alloc_tid(hammer_mount_t hmp, int count)
        if (tid >= 0xFFFFFFFFFF000000ULL)
                hpanic("Ran out of TIDs!");
        if (hammer_debug_tid)
-               hdkprintf("%016llx\n", (long long)tid);
+               hdkprintf("%016jx\n", (intmax_t)tid);
        return(tid);
 }
 
index db35910..460ad49 100644 (file)
@@ -230,8 +230,8 @@ hammer_generate_undo(hammer_transaction_t trans,
                                (int)sizeof(struct hammer_fifo_tail);
                }
                if (hammer_debug_general & 0x0080) {
-                       hdkprintf("undo %016llx %d %d\n",
-                               (long long)next_offset, bytes, n);
+                       hdkprintf("undo %016jx %d %d\n",
+                               (intmax_t)next_offset, bytes, n);
                }
 
                undo->head.hdr_signature = HAMMER_HEAD_SIGNATURE;
index 9c6fbbd..7d68fcf 100644 (file)
@@ -1256,9 +1256,9 @@ hammer_vop_nresolve(struct vop_nresolve_args *ap)
                                      flags, &error);
                if (error == ENOENT) {
                        hkprintf("WARNING: Missing inode for dirent \"%s\"\n"
-                               "\tobj_id = %016llx, asof=%016llx, lo=%08x\n",
+                               "\tobj_id = %016jx, asof=%016jx, lo=%08x\n",
                                ncp->nc_name,
-                               (long long)obj_id, (long long)asof,
+                               (intmax_t)obj_id, (intmax_t)asof,
                                localization);
                        error = 0;
                        ip = hammer_get_dummy_inode(&trans, dip, obj_id,
@@ -1336,8 +1336,8 @@ hammer_vop_nlookupdotdot(struct vop_nlookupdotdot_args *ap)
                        parent_obj_id = dip->obj_id;
                        asof = hmp->asof;
                        *ap->a_fakename = kmalloc(19, M_TEMP, M_WAITOK);
-                       ksnprintf(*ap->a_fakename, 19, "0x%016llx",
-                                 (long long)dip->obj_asof);
+                       ksnprintf(*ap->a_fakename, 19, "0x%016jx",
+                                 (intmax_t)dip->obj_asof);
                } else {
                        *ap->a_vpp = NULL;
                        lwkt_reltoken(&hmp->fs_token);
@@ -1819,8 +1819,8 @@ hammer_vop_readlink(struct vop_readlink_args *ap)
                                if (hammer_is_pfs_slave(&pfsm->pfsd)) {
                                        /* vap->va_size == 26 */
                                        ksnprintf(buf, sizeof(buf),
-                                                 "@@0x%016llx:%05d",
-                                                 (long long)pfsm->pfsd.sync_end_tid,
+                                                 "@@0x%016jx:%05d",
+                                                 (intmax_t)pfsm->pfsd.sync_end_tid,
                                                  lo_to_pfs(localization));
                                } else {
                                        /* vap->va_size == 10 */
@@ -3397,9 +3397,9 @@ retry:
                if (error == ENOENT) {
                        hkprintf("WARNING: Removing dirent w/missing inode "
                                "\"%s\"\n"
-                               "\tobj_id = %016llx\n",
+                               "\tobj_id = %016jx\n",
                                ncp->nc_name,
-                               (long long)cursor.data->entry.obj_id);
+                               (intmax_t)cursor.data->entry.obj_id);
                        error = 0;
                }