From: Andrew Deason Date: Tue, 8 Jan 2013 23:41:21 +0000 (-0600) Subject: SOLARIS: Use vn_renamepath when available X-Git-Tag: upstream/1.6.2_pre3^2~2 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=3697dc8506c25a9b108644a94419efa9f12f5f5d;p=packages%2Fo%2Fopenafs.git SOLARIS: Use vn_renamepath when available In Solaris 11.1, the signature of vn_setpath changes; it gains an extra boolean_t argument called 'force'. Instead of trying to adapt to it, call vn_renamepath() instead, which will do the correct thing and call vn_setpath &co for us. vn_renamepath has existed since Solaris 10 Update 8, and is in all releases of Solaris 11. Only call it in Solaris 11, since it makes the ifdefs easier, and there are no problems with calling vn_setpath on Solaris 10. Thanks to Frank Batschulat for all of the relevant information. Reviewed-on: http://gerrit.openafs.org/8894 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit 6c50960174f35d75fd50956e248318a9c826fca1) Change-Id: Ifdc5bb7785b791d36dc1523421badd29d8df2faa Reviewed-on: http://gerrit.openafs.org/8896 Tested-by: BuildBot Reviewed-by: Paul Smeddle Reviewed-by: Stephan Wiesand --- diff --git a/src/afs/SOLARIS/osi_vnodeops.c b/src/afs/SOLARIS/osi_vnodeops.c index 6eb228ea1..c74b87bcd 100644 --- a/src/afs/SOLARIS/osi_vnodeops.c +++ b/src/afs/SOLARIS/osi_vnodeops.c @@ -1706,7 +1706,10 @@ gafs_rename(struct vcache *aodp, char *aname1, (void) afs_lookup(andp, aname2, &avcp, NULL, 0, NULL, acred); if (avcp) { struct vnode *vp = AFSTOV(avcp), *pvp = AFSTOV(andp); - + +# ifdef AFS_SUN511_ENV + vn_renamepath(pvp, vp, aname2, strlen(aname2)); +# else mutex_enter(&vp->v_lock); if (vp->v_path != NULL) { kmem_free(vp->v_path, strlen(vp->v_path) + 1); @@ -1714,6 +1717,7 @@ gafs_rename(struct vcache *aodp, char *aname1, } mutex_exit(&vp->v_lock); vn_setpath(afs_globalVp, pvp, vp, aname2, strlen(aname2)); +# endif /* !AFS_SUN511_ENV */ AFS_RELE(avcp); }