summaryrefslogtreecommitdiffstats
path: root/usr.bin/fstat
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2008-05-07 18:27:38 +0000
committerjhb <jhb@FreeBSD.org>2008-05-07 18:27:38 +0000
commitd67ee9e0f3caddf223f82d077e1f382d13377e1f (patch)
tree2839bf41cce8dbe8c86e32a77dde4e42d0e41c4c /usr.bin/fstat
parent0a5997816c443b9948bffe1d6ba8b27f379f9b71 (diff)
downloadFreeBSD-src-d67ee9e0f3caddf223f82d077e1f382d13377e1f.zip
FreeBSD-src-d67ee9e0f3caddf223f82d077e1f382d13377e1f.tar.gz
Fix reading the address of a znode_phys from a znode on 64-bit platforms
where sizeof(pointer) != sizeof(int). MFC after: 1 week PR: amd64/123456 Submitted by: KOIE Hidetaka | hide koie.org
Diffstat (limited to 'usr.bin/fstat')
-rw-r--r--usr.bin/fstat/zfs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/fstat/zfs.c b/usr.bin/fstat/zfs.c
index 123fdc2..375f986 100644
--- a/usr.bin/fstat/zfs.c
+++ b/usr.bin/fstat/zfs.c
@@ -68,7 +68,7 @@ zfs_filestat(struct vnode *vp, struct filestat *fsp)
uint64_t *zid;
void *znodeptr, *vnodeptr;
char *dataptr;
- int *zphys_addr;
+ void *zphys_addr;
size_t len;
int size;
@@ -100,9 +100,9 @@ zfs_filestat(struct vnode *vp, struct filestat *fsp)
*/
dataptr = znodeptr;
zid = (uint64_t *)(dataptr + LOCATION_ZID);
- zphys_addr = (int *)(dataptr + LOCATION_ZPHYS(size));
+ zphys_addr = *(void **)(dataptr + LOCATION_ZPHYS(size));
- if (!KVM_READ(*zphys_addr, &zphys, sizeof(zphys))) {
+ if (!KVM_READ(zphys_addr, &zphys, sizeof(zphys))) {
dprintf(stderr, "can't read znode_phys at %p for pid %d\n",
zphys_addr, Pid);
goto bad;
OpenPOWER on IntegriCloud