diff options
author | Rich Ercolani <[email protected]> | 2021-06-23 00:53:45 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-22 21:53:45 -0700 |
commit | 8e739b2c9ff446457ad04f63a3ee127ded70b996 (patch) | |
tree | cb8aed16bf38ded6d8018b2671b70c2b5741c595 /module/os | |
parent | a81b812495a20623a49c797d255ee5d89fc38790 (diff) |
Annotated dprintf as printf-like
ZFS loves using %llu for uint64_t, but that requires a cast to not
be noisy - which is even done in many, though not all, places.
Also a couple places used %u for uint64_t, which were promoted
to %llu.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rich Ercolani <[email protected]>
Closes #12233
Diffstat (limited to 'module/os')
-rw-r--r-- | module/os/freebsd/zfs/zfs_debug.c | 2 | ||||
-rw-r--r-- | module/os/freebsd/zfs/zfs_vfsops.c | 9 | ||||
-rw-r--r-- | module/os/linux/zfs/zfs_debug.c | 3 |
3 files changed, 9 insertions, 5 deletions
diff --git a/module/os/freebsd/zfs/zfs_debug.c b/module/os/freebsd/zfs/zfs_debug.c index 7239db808..dad342b06 100644 --- a/module/os/freebsd/zfs/zfs_debug.c +++ b/module/os/freebsd/zfs/zfs_debug.c @@ -181,7 +181,7 @@ __set_error(const char *file, const char *func, int line, int err) * $ echo 512 >/sys/module/zfs/parameters/zfs_flags */ if (zfs_flags & ZFS_DEBUG_SET_ERROR) - __dprintf(B_FALSE, file, func, line, "error %lu", err); + __dprintf(B_FALSE, file, func, line, "error %lu", (ulong_t)err); } #ifdef _KERNEL diff --git a/module/os/freebsd/zfs/zfs_vfsops.c b/module/os/freebsd/zfs/zfs_vfsops.c index 4e22206de..42e11eeb1 100644 --- a/module/os/freebsd/zfs/zfs_vfsops.c +++ b/module/os/freebsd/zfs/zfs_vfsops.c @@ -1060,7 +1060,7 @@ zfsvfs_setup(zfsvfs_t *zfsvfs, boolean_t mounting) &zfsvfs->z_kstat, zs.zs_num_entries); dprintf_ds(zfsvfs->z_os->os_dsl_dataset, "num_entries in unlinked set: %llu", - zs.zs_num_entries); + (u_longlong_t)zs.zs_num_entries); } zfs_unlinked_drain(zfsvfs); @@ -1874,7 +1874,9 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int flags, vnode_t **vpp) gen_mask = -1ULL >> (64 - 8 * i); - dprintf("getting %llu [%u mask %llx]\n", object, fid_gen, gen_mask); + dprintf("getting %llu [%llu mask %llx]\n", (u_longlong_t)object, + (u_longlong_t)fid_gen, + (u_longlong_t)gen_mask); if ((err = zfs_zget(zfsvfs, object, &zp))) { ZFS_EXIT(zfsvfs); return (err); @@ -1885,7 +1887,8 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int flags, vnode_t **vpp) if (zp_gen == 0) zp_gen = 1; if (zp->z_unlinked || zp_gen != fid_gen) { - dprintf("znode gen (%u) != fid gen (%u)\n", zp_gen, fid_gen); + dprintf("znode gen (%llu) != fid gen (%llu)\n", + (u_longlong_t)zp_gen, (u_longlong_t)fid_gen); vrele(ZTOV(zp)); ZFS_EXIT(zfsvfs); return (SET_ERROR(EINVAL)); diff --git a/module/os/linux/zfs/zfs_debug.c b/module/os/linux/zfs/zfs_debug.c index 8d7f04097..98c9923d5 100644 --- a/module/os/linux/zfs/zfs_debug.c +++ b/module/os/linux/zfs/zfs_debug.c @@ -127,7 +127,8 @@ __set_error(const char *file, const char *func, int line, int err) * $ echo 512 >/sys/module/zfs/parameters/zfs_flags */ if (zfs_flags & ZFS_DEBUG_SET_ERROR) - __dprintf(B_FALSE, file, func, line, "error %lu", err); + __dprintf(B_FALSE, file, func, line, "error %lu", + (ulong_t)err); } void |