Index: stand/efi/boot1/zfs_module.c =================================================================== --- stand/efi/boot1/zfs_module.c +++ stand/efi/boot1/zfs_module.c @@ -50,7 +50,7 @@ } static int -vdev_read(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) +vdev_read(vdev_t *vdev, void *priv, uint64_t off, void *buf, size_t bytes) { dev_info_t *devinfo; uint64_t lba; Index: stand/geli/geliboot.h =================================================================== --- stand/geli/geliboot.h +++ stand/geli/geliboot.h @@ -51,7 +51,7 @@ struct dsk; void geli_init(void); -int geli_taste(int read_func(void *vdev, void *priv, off_t off, +int geli_taste(int read_func(void *vdev, void *priv, uint64_t off, void *buf, size_t bytes), struct dsk *dsk, daddr_t lastsector); int is_geli(struct dsk *dsk); int geli_read(struct dsk *dsk, off_t offset, u_char *buf, size_t bytes); Index: stand/geli/geliboot.c =================================================================== --- stand/geli/geliboot.c +++ stand/geli/geliboot.c @@ -151,7 +151,7 @@ * if it is GELI encrypted */ int -geli_taste(int read_func(void *vdev, void *priv, off_t off, void *buf, +geli_taste(int read_func(void *vdev, void *priv, uint64_t off, void *buf, size_t bytes), struct dsk *dskp, daddr_t lastsector) { struct g_eli_metadata md; Index: stand/i386/gptboot/gptboot.c =================================================================== --- stand/i386/gptboot/gptboot.c +++ stand/i386/gptboot/gptboot.c @@ -106,7 +106,7 @@ static int parse_cmds(char *, int *); static int dskread(void *, daddr_t, unsigned); #ifdef LOADER_GELI_SUPPORT -static int vdev_read(void *vdev __unused, void *priv, off_t off, void *buf, +static int vdev_read(void *vdev __unused, void *priv, uint64_t off, void *buf, size_t bytes); #endif @@ -614,7 +614,7 @@ * Implementation the same for both UFS and ZFS */ static int -vdev_read(void *vdev __unused, void *priv, off_t off, void *buf, size_t bytes) +vdev_read(void *vdev __unused, void *priv, uint64_t off, void *buf, size_t bytes) { char *p; daddr_t lba; Index: stand/i386/libi386/biosdisk.c =================================================================== --- stand/i386/libi386/biosdisk.c +++ stand/i386/libi386/biosdisk.c @@ -146,7 +146,7 @@ }; static enum isgeli geli_status[MAXBDDEV][MAXTBLENTS]; -int bios_read(void *, void *, off_t off, void *buf, size_t bytes); +int bios_read(void *, void *, uint64_t off, void *buf, size_t bytes); #endif /* LOADER_GELI_SUPPORT */ struct devsw biosdisk = { @@ -846,7 +846,7 @@ { #ifdef LOADER_GELI_SUPPORT struct dsk dskp; - off_t p_off, diff; + uint64_t p_off, diff; daddr_t alignlba; int err, n, alignblks; char *tmpbuf; @@ -1009,7 +1009,8 @@ #ifdef LOADER_GELI_SUPPORT int -bios_read(void *vdev __unused, void *xpriv, off_t off, void *buf, size_t bytes) +bios_read(void *vdev __unused, void *xpriv, uint64_t off, void *buf, + size_t bytes) { struct disk_devdesc dev; struct dsk *priv = xpriv; Index: stand/i386/zfsboot/zfsboot.c =================================================================== --- stand/i386/zfsboot/zfsboot.c +++ stand/i386/zfsboot/zfsboot.c @@ -138,7 +138,8 @@ * Read from a dnode (which must be from a ZPL filesystem). */ static int -zfs_read(spa_t *spa, const dnode_phys_t *dnode, off_t *offp, void *start, size_t size) +zfs_read(spa_t *spa, const dnode_phys_t *dnode, uint64_t *offp, void *start, + size_t size) { const znode_phys_t *zp = (const znode_phys_t *) dnode->dn_bonus; size_t n; @@ -168,11 +169,11 @@ * buffer pointer crosses a 64k boundary. */ static int -vdev_read(void *xvdev, void *priv, off_t off, void *buf, size_t bytes) +vdev_read(void *xvdev, void *priv, uint64_t off, void *buf, size_t bytes) { char *p; daddr_t lba, alignlba; - off_t diff; + uint64_t diff; unsigned int nb, alignnb; struct dsk *dsk = (struct dsk *) priv; @@ -232,14 +233,14 @@ } /* Match the signature exactly due to signature madness */ static int -vdev_read2(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) +vdev_read2(vdev_t *vdev, void *priv, uint64_t off, void *buf, size_t bytes) { return vdev_read(vdev, priv, off, buf, bytes); } static int -vdev_write(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) +vdev_write(vdev_t *vdev, void *priv, uint64_t off, void *buf, size_t bytes) { char *p; daddr_t lba; @@ -268,7 +269,7 @@ } static int -xfsread(const dnode_phys_t *dnode, off_t *offp, void *buf, size_t nbyte) +xfsread(const dnode_phys_t *dnode, uint64_t *offp, void *buf, size_t nbyte) { if ((size_t)zfs_read(spa, dnode, offp, buf, nbyte) != nbyte) { printf("Invalid format\n"); @@ -286,7 +287,7 @@ { blkptr_t bp; char *tmp = zap_scratch; - off_t off = offsetof(vdev_label_t, vl_pad2); + uint64_t off = offsetof(vdev_label_t, vl_pad2); if (size > VDEV_PAD_SIZE) size = VDEV_PAD_SIZE; @@ -308,7 +309,7 @@ { char *zeroes = zap_scratch; uint64_t *end; - off_t off = offsetof(vdev_label_t, vl_pad2); + uint64_t off = offsetof(vdev_label_t, vl_pad2); memset(zeroes, 0, VDEV_PAD_SIZE); end = (uint64_t *)(zeroes + VDEV_PAD_SIZE); @@ -668,7 +669,7 @@ main(void) { dnode_phys_t dn; - off_t off; + uint64_t off; struct dsk *dsk; int autoboot, i; int nextboot; @@ -891,7 +892,7 @@ static Elf32_Shdr es[2]; caddr_t p; dnode_phys_t dn; - off_t off; + uint64_t off; uint32_t addr, x; int fmt, i, j; Index: stand/zfs/zfs.c =================================================================== --- stand/zfs/zfs.c +++ stand/zfs/zfs.c @@ -359,12 +359,12 @@ } static int -vdev_read(vdev_t *vdev, void *priv, off_t offset, void *buf, size_t bytes) +vdev_read(vdev_t *vdev, void *priv, uint64_t offset, void *buf, size_t bytes) { int fd, ret; size_t res, size, remainder, rb_size, blksz; unsigned secsz; - off_t off; + uint64_t off; char *bouncebuf, *rb_buf; fd = (uintptr_t) priv; Index: stand/zfs/zfsimpl.c =================================================================== --- stand/zfs/zfsimpl.c +++ stand/zfs/zfsimpl.c @@ -408,7 +408,7 @@ static int vdev_read_phys(vdev_t *vdev, const blkptr_t *bp, void *buf, - off_t offset, size_t size) + uint64_t offset, size_t size) { size_t psize; int rc; @@ -434,7 +434,7 @@ static int vdev_disk_read(vdev_t *vdev, const blkptr_t *bp, void *buf, - off_t offset, size_t bytes) + uint64_t offset, size_t bytes) { return (vdev_read_phys(vdev, bp, buf, @@ -444,7 +444,7 @@ static int vdev_mirror_read(vdev_t *vdev, const blkptr_t *bp, void *buf, - off_t offset, size_t bytes) + uint64_t offset, size_t bytes) { vdev_t *kid; int rc; @@ -463,7 +463,7 @@ static int vdev_replacing_read(vdev_t *vdev, const blkptr_t *bp, void *buf, - off_t offset, size_t bytes) + uint64_t offset, size_t bytes) { vdev_t *kid; @@ -935,7 +935,7 @@ vdev_phys_t *tmp_label; spa_t *spa; vdev_t *vdev, *top_vdev, *pool_vdev; - off_t off; + uint64_t off; blkptr_t bp; const unsigned char *nvlist = NULL; uint64_t val; @@ -1253,7 +1253,7 @@ const dva_t *dva = &bp->blk_dva[i]; vdev_t *vdev; int vdevid; - off_t offset; + uint64_t offset; if (!dva->dva_word[0] && !dva->dva_word[1]) continue; @@ -1300,7 +1300,8 @@ } static int -dnode_read(const spa_t *spa, const dnode_phys_t *dnode, off_t offset, void *buf, size_t buflen) +dnode_read(const spa_t *spa, const dnode_phys_t *dnode, uint64_t offset, + void *buf, size_t buflen) { int ibshift = dnode->dn_indblkshift - SPA_BLKPTRSHIFT; int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; @@ -1519,10 +1520,11 @@ { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; + zap_leaf_chunk_t *zc; fat_zap_t z; uint64_t *ptrtbl; - uint64_t hash; - int rc; + uint64_t hash, off; + int shift, h, rc; if (zh.zap_magic != ZAP_MAGIC) return (EIO); @@ -1548,8 +1550,7 @@ zap_leaf_t zl; zl.l_bs = z.zap_block_shift; - off_t off = ptrtbl[hash >> (64 - zh.zap_ptrtbl.zt_shift)] << zl.l_bs; - zap_leaf_chunk_t *zc; + off = ptrtbl[hash >> (64 - zh.zap_ptrtbl.zt_shift)] << zl.l_bs; rc = dnode_read(spa, dnode, off, zap_scratch, bsize); if (rc) @@ -1568,8 +1569,8 @@ /* * Hash within the chunk to find our entry. */ - int shift = (64 - ZAP_LEAF_HASH_SHIFT(&zl) - zl.l_phys->l_hdr.lh_prefix_len); - int h = (hash >> shift) & ((1 << ZAP_LEAF_HASH_SHIFT(&zl)) - 1); + shift = 64 - ZAP_LEAF_HASH_SHIFT(&zl) - zl.l_phys->l_hdr.lh_prefix_len; + h = (hash >> shift) & ((1 << ZAP_LEAF_HASH_SHIFT(&zl)) - 1); h = zl.l_phys->l_hash[h]; if (h == 0xffff) return (ENOENT); @@ -1675,7 +1676,7 @@ zap_leaf_t zl; zl.l_bs = z.zap_block_shift; for (i = 0; i < zh.zap_num_leafs; i++) { - off_t off = (i + 1) << zl.l_bs; + uint64_t off = (i + 1) << zl.l_bs; char name[256], *p; uint64_t value; @@ -1755,9 +1756,10 @@ } static int -objset_get_dnode(const spa_t *spa, const objset_phys_t *os, uint64_t objnum, dnode_phys_t *dnode) +objset_get_dnode(const spa_t *spa, const objset_phys_t *os, uint64_t objnum, + dnode_phys_t *dnode) { - off_t offset; + uint64_t offset; offset = objnum * sizeof(dnode_phys_t); return dnode_read(spa, &os->os_meta_dnode, offset, @@ -1818,7 +1820,8 @@ } static int -fzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) +fzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, + uint64_t value) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -1838,7 +1841,7 @@ zap_leaf_t zl; zl.l_bs = z.zap_block_shift; for (i = 0; i < zh.zap_num_leafs; i++) { - off_t off = (i + 1) << zl.l_bs; + uint64_t off = (i + 1) << zl.l_bs; if (dnode_read(spa, dnode, off, zap_scratch, bsize)) return (EIO); @@ -1866,7 +1869,8 @@ } static int -zap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) +zap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, + uint64_t value) { int rc; uint64_t zap_type; Index: sys/cddl/boot/zfs/zfsimpl.h =================================================================== --- sys/cddl/boot/zfs/zfsimpl.h +++ sys/cddl/boot/zfs/zfsimpl.h @@ -1515,9 +1515,9 @@ struct vdev; struct spa; typedef int vdev_phys_read_t(struct vdev *vdev, void *priv, - off_t offset, void *buf, size_t bytes); + uint64_t offset, void *buf, size_t bytes); typedef int vdev_read_t(struct vdev *vdev, const blkptr_t *bp, - void *buf, off_t offset, size_t bytes); + void *buf, uint64_t offset, size_t bytes); typedef STAILQ_HEAD(vdev_list, vdev) vdev_list_t; Index: sys/cddl/boot/zfs/zfssubr.c =================================================================== --- sys/cddl/boot/zfs/zfssubr.c +++ sys/cddl/boot/zfs/zfssubr.c @@ -1187,8 +1187,8 @@ } static raidz_map_t * -vdev_raidz_map_alloc(void *data, off_t offset, size_t size, uint64_t unit_shift, - uint64_t dcols, uint64_t nparity) +vdev_raidz_map_alloc(void *data, uint64_t offset, size_t size, + uint64_t unit_shift, uint64_t dcols, uint64_t nparity) { raidz_map_t *rm; uint64_t b = offset >> unit_shift; @@ -1386,7 +1386,8 @@ */ static int vdev_raidz_combrec(const spa_t *spa, raidz_map_t *rm, const blkptr_t *bp, - void *data, off_t offset, uint64_t bytes, int total_errors, int data_errors) + void *data, uint64_t offset, uint64_t bytes, int total_errors, + int data_errors) { raidz_col_t *rc; void *orig[VDEV_RAIDZ_MAXPARITY]; @@ -1529,7 +1530,7 @@ static int vdev_raidz_read(vdev_t *vd, const blkptr_t *bp, void *data, - off_t offset, size_t bytes) + uint64_t offset, size_t bytes) { vdev_t *tvd = vd->v_top; vdev_t *cvd;