From: Ben Kaduk Date: Tue, 21 Jun 2011 02:35:08 +0000 (-0400) Subject: FBSD: use better casts in vop_advlock X-Git-Tag: upstream/1.8.0_pre1^2~3516 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e798bcaf97c3ad1b464e29482cb29074cbbf33d6;p=packages%2Fo%2Fopenafs.git FBSD: use better casts in vop_advlock In the bsd.kmod.mk world, the compiler bails when we cast a pointer directly to int. Cast through intptr_t as the supported mechanism. On amd64, this loses bits, but since this instance is just attempting to use the value as a unique handle, it is probably okay for now. However, it should be addressed more properly eventually, when this locking implementation sees wider use. Change-Id: I4fe8084c14a97dc4efc8d74e9971b1540c028e40 Reviewed-on: http://gerrit.openafs.org/5034 Reviewed-by: Matt Benjamin Reviewed-by: Garrett Wollman Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/afs/FBSD/osi_vnodeops.c b/src/afs/FBSD/osi_vnodeops.c index 5be9ad021..311b5a959 100644 --- a/src/afs/FBSD/osi_vnodeops.c +++ b/src/afs/FBSD/osi_vnodeops.c @@ -1590,7 +1590,10 @@ afs_vop_advlock(ap) AFS_GLOCK(); error = - afs_lockctl(VTOAFS(ap->a_vp), ap->a_fl, ap->a_op, &cr, (int)ap->a_id); + afs_lockctl(VTOAFS(ap->a_vp), + ap->a_fl, + ap->a_op, &cr, + (int)(intptr_t)ap->a_id); /* XXX: no longer unique! */ AFS_GUNLOCK(); return error; }