]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
FBSD: deal with kernel API rename
authorBen Kaduk <kaduk@mit.edu>
Sat, 8 Oct 2011 21:16:26 +0000 (17:16 -0400)
committerDerrick Brashear <shadow@dementix.org>
Sat, 29 Oct 2011 22:31:09 +0000 (15:31 -0700)
Upstream decided to rename the kernel functions that implement
syscalls to have a sys_prefix (including afs3_syscall!).
We use a couple of them, so we need to conditionalize accordingly.
Unfortunately, __FreeBSD_version was not bumped with the change,
so we use something close to it and hope it's close enough.

Reviewed-on: http://gerrit.openafs.org/5572
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 4a1d319177ea0e58c9046c3c173bb7d2877d1bc3)

Change-Id: I01d943398a3c15009f72f668720bfe6bc8eac63d
Reviewed-on: http://gerrit.openafs.org/5639
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
src/afs/FBSD/osi_groups.c
src/afs/afs_pioctl.c
src/afs/afs_prototypes.h
src/rx/FBSD/rx_knet.c

index ef624782489826047b96912fd00b3827f6916a86..e897f461040dc5d5c09933d082ef83446fef70cb 100644 (file)
@@ -48,9 +48,17 @@ Afs_xsetgroups(struct thread *td, struct setgroups_args *uap)
     AFS_GUNLOCK();
     crfree(cr);
     if (code)
+#if (__FreeBSD_version >= 900044)
+       return sys_setgroups(td, uap);  /* afs has shut down */
+#else
        return setgroups(td, uap);      /* afs has shut down */
+#endif
 
+#if (__FreeBSD_version >= 900044)
+    code = sys_setgroups(td, uap);
+#else
     code = setgroups(td, uap);
+#endif
     /* Note that if there is a pag already in the new groups we don't
      * overwrite it with the old pag.
      */
index 5ffb36626bf28392065f13467d728085bf9fcae3..9e64b03f4397a83c749724b7432856dde55c73c8 100644 (file)
@@ -850,7 +850,11 @@ afs_xioctl(afs_proc_t *p, struct ioctl_args *uap, register_t *retval)
 
     if (!ioctlDone) {
 # if defined(AFS_FBSD_ENV)
+#  if (__FreeBSD_version >= 900044)
+       return sys_ioctl(td, uap);
+#  else
        return ioctl(td, uap);
+#  endif
 # elif defined(AFS_OBSD_ENV)
        code = sys_ioctl(p, uap, retval);
 # elif defined(AFS_NBSD_ENV)
index 4d8a26e72ecfbffdb6eb63948585280a6ebfb03f..28e2010421581d752951b48d7d7e20390465acab 100644 (file)
@@ -911,8 +911,9 @@ extern int copyin_afs_ioctl(caddr_t cmarg, struct afs_ioctl *dst);
 #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
 #ifdef AFS_DARWIN100_ENV
 extern int afs3_syscall(afs_proc_t *p, void *args, unsigned int *retval);
-#elif defined(AFS_FBSD90_ENV) || defined(AFS_FBSD82_ENV)
-/* afs3_syscall prototype is in sys/sysproto.h */
+#elif (defined(AFS_FBSD90_ENV) || defined(AFS_FBSD82_ENV)) && (__FreeBSD_version < 900044)
+/* afs3_syscall prototype is in sys/sysproto.h
+   Yes, they put it in, then took it out again (renamed with a sys_ prefix) */
 #elif defined(AFS_FBSD_ENV)
 extern int afs3_syscall(struct thread *p, void *args);
 #elif defined(AFS_NBSD40_ENV)
index c6d2d842dfe8d56aa48be61b834d87bc9d59d5f0..ded3f7c6a00e796db2c1f91e6592b56e25df9522 100644 (file)
@@ -92,7 +92,11 @@ osi_StopListener(void)
     p = pfind(rxk_ListenerPid);
     if (p) {
        afs_warn("osi_StopListener: rxk_ListenerPid %u\n", rxk_ListenerPid);
+#if (__FreeBSD_version >= 90004)
+       kern_psignal(p, SIGUSR1);
+#else
        psignal(p, SIGUSR1);
+#endif
        PROC_UNLOCK(p);
     } else
        afs_warn("osi_StopListener: rxk_Listener not found (pid %u)\n",