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 <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
Andrew Deason 2022-10-25 15:27:50 -05:00
parent 6e92423ba8
commit 890ae8e4ff

View File

@ -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;