summaryrefslogtreecommitdiffstats
path: root/sys/boot/zfs
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2012-05-12 20:23:30 +0000
committeravg <avg@FreeBSD.org>2012-05-12 20:23:30 +0000
commit1218acb302eabe62732caff18eabb18eba54eff0 (patch)
tree84ed837d9ec194424ac194f2151ef28a0f9986ed /sys/boot/zfs
parentb3431e25a4b0ce6aa77223ffbcea2ed5d24fa1d6 (diff)
downloadFreeBSD-src-1218acb302eabe62732caff18eabb18eba54eff0.zip
FreeBSD-src-1218acb302eabe62732caff18eabb18eba54eff0.tar.gz
zfs boot code: use %j and uintmax_t instead %ll and uint64_t in printfs
This is to silence warnings that result from different definitions of uint64_t on different architectures, specifically i386 and sparc64. MFC after: 1 month
Diffstat (limited to 'sys/boot/zfs')
-rw-r--r--sys/boot/zfs/zfs.c4
-rw-r--r--sys/boot/zfs/zfsimpl.c20
2 files changed, 13 insertions, 11 deletions
diff --git a/sys/boot/zfs/zfs.c b/sys/boot/zfs/zfs.c
index c90e1c7..d474181 100644
--- a/sys/boot/zfs/zfs.c
+++ b/sys/boot/zfs/zfs.c
@@ -433,8 +433,8 @@ zfs_dev_open_spa(struct open_file *f, spa_t *spa, uint64_t root_guid)
return (rv);
}
if (mount->objset.os_type != DMU_OST_ZFS) {
- printf("Unexpected object set type %llu\n",
- mount->objset.os_type);
+ printf("Unexpected object set type %ju\n",
+ (uintmax_t)mount->objset.os_type);
free(mount);
return (EIO);
}
diff --git a/sys/boot/zfs/zfsimpl.c b/sys/boot/zfs/zfsimpl.c
index d70112e..e67728e 100644
--- a/sys/boot/zfs/zfsimpl.c
+++ b/sys/boot/zfs/zfsimpl.c
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
*/
#include <sys/stat.h>
+#include <sys/stdint.h>
#include "zfsimpl.h"
#include "zfssubr.c"
@@ -290,7 +291,7 @@ nvlist_print(const unsigned char *nvlist, unsigned int indent)
case DATA_TYPE_UINT64: {
uint64_t val;
xdr_uint64_t(&p, &val);
- printf(" = 0x%llx\n", val);
+ printf(" = 0x%jx\n", (uintmax_t)val);
break;
}
@@ -350,7 +351,7 @@ vdev_read_phys(vdev_t *vdev, const blkptr_t *bp, void *buf,
psize = size;
}
- /*printf("ZFS: reading %d bytes at 0x%llx to %p\n", psize, offset, buf);*/
+ /*printf("ZFS: reading %d bytes at 0x%jx to %p\n", psize, (uintmax_t)offset, buf);*/
rc = vdev->v_phys_read(vdev, vdev->v_read_priv, offset, buf, psize);
if (rc)
return (rc);
@@ -1375,7 +1376,7 @@ mzap_list(spa_t *spa, const dnode_phys_t *dnode)
for (i = 0; i < chunks; i++) {
mze = &mz->mz_chunk[i];
if (mze->mze_name[0])
- //printf("%-32s 0x%llx\n", mze->mze_name, mze->mze_value);
+ //printf("%-32s 0x%jx\n", mze->mze_name, (uintmax_t)mze->mze_value);
printf("%s\n", mze->mze_name);
}
@@ -1449,7 +1450,7 @@ fzap_list(spa_t *spa, const dnode_phys_t *dnode)
*/
value = fzap_leaf_value(&zl, zc);
- printf("%s 0x%llx\n", name, value);
+ printf("%s 0x%jx\n", name, (uintmax_t)value);
}
}
@@ -1649,7 +1650,7 @@ zfs_rlookup(spa_t *spa, uint64_t objnum, char *result)
*p = '\0';
if (objset_get_dnode(spa, &spa->spa_mos, objnum, &dataset)) {
- printf("ZFS: can't find dataset %llu\n", objnum);
+ printf("ZFS: can't find dataset %ju\n", (uintmax_t)objnum);
return (EIO);
}
ds = (dsl_dataset_phys_t *)&dataset.dn_bonus;
@@ -1751,13 +1752,14 @@ zfs_mount_dataset(spa_t *spa, uint64_t objnum, objset_phys_t *objset)
dsl_dataset_phys_t *ds;
if (objset_get_dnode(spa, &spa->spa_mos, objnum, &dataset)) {
- printf("ZFS: can't find dataset %llu\n", objnum);
+ printf("ZFS: can't find dataset %ju\n", (uintmax_t)objnum);
return (EIO);
}
ds = (dsl_dataset_phys_t *) &dataset.dn_bonus;
if (zio_read(spa, &ds->ds_bp, objset)) {
- printf("ZFS: can't read object set for dataset %llu\n", objnum);
+ printf("ZFS: can't read object set for dataset %ju\n",
+ (uintmax_t)objnum);
return (EIO);
}
@@ -1921,8 +1923,8 @@ zfs_lookup(const struct zfsmount *mount, const char *upath, dnode_phys_t *dnode)
spa = mount->spa;
if (mount->objset.os_type != DMU_OST_ZFS) {
- printf("ZFS: unexpected object set type %llu\n",
- mount->objset.os_type);
+ printf("ZFS: unexpected object set type %ju\n",
+ (uintmax_t)mount->objset.os_type);
return (EIO);
}
OpenPOWER on IntegriCloud