From 890ae8e4ff8fde451fc4346b51378afdb1f9f75e Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Tue, 25 Oct 2022 15:27:50 -0500 Subject: [PATCH] FBSD: Handle 2-arg vget() FreeBSD commit a92a971bbb94ad5b44e2a5bbdc669ad3ae762c8d (vfs: remove the thread argument from vget) dropped the third arg from vget(), since it was effectively required to always be the current thread. Use a small wrapper AFS_VGET() to select the right macro to call. Change-Id: I9efb0c53d2051555b8c835e991cc3e360982fa3c Reviewed-on: https://gerrit.openafs.org/15169 Reviewed-by: Michael Meffie Reviewed-by: Andrew Deason Tested-by: BuildBot --- src/afs/FBSD/osi_vfsops.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/afs/FBSD/osi_vfsops.c b/src/afs/FBSD/osi_vfsops.c index 0f5628148d..4fde03760f 100644 --- a/src/afs/FBSD/osi_vfsops.c +++ b/src/afs/FBSD/osi_vfsops.c @@ -19,6 +19,13 @@ int afs_pbuf_freecnt = -1; extern int Afs_xsetgroups(); +/* r364271 dropped the 'td' arg from vget() */ +#if __FreeBSD_version >= 1300108 +# define AFS_VGET(vp, flags) vget(vp, flags) +#else +# define AFS_VGET(vp, flags) vget(vp, flags, curthread) +#endif + static struct syscall_helper_data afs_syscalls[] = { { .syscall_no = AFS_SYSCALL, @@ -197,7 +204,6 @@ afs_root(struct mount *mp, int flags, struct vnode **vpp) struct vrequest treq; struct vcache *tvp = 0; struct vcache *gvp; - struct thread *td = curthread; struct ucred *cr = osi_curcred(); AFS_GLOCK(); @@ -231,7 +237,7 @@ tryagain: ASSERT_VI_UNLOCKED(vp, "afs_root"); AFS_GUNLOCK(); - error = vget(vp, LK_EXCLUSIVE | LK_RETRY, td); + error = AFS_VGET(vp, LK_EXCLUSIVE | LK_RETRY); AFS_GLOCK(); if (error != 0) { goto tryagain;