From: Matt Benjamin Date: Fri, 27 Aug 2010 02:54:20 +0000 (-0400) Subject: FBSD restore old syscall register logic for older kernels X-Git-Tag: openafs-devel-1_5_77~33 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=f15ddd746beb01c7e629d5fa1f60cd1b21753d1b;p=packages%2Fo%2Fopenafs.git FBSD restore old syscall register logic for older kernels The syscall_register code appears to depend on coordination with FreeBSD upstream, which hopefully can be completed by RELENG_9. Use the original code for installation of the AFS syscall everything older than that. Change-Id: I2954cf1a2ae3587a311e8133ec5cdc500b4e2e24 Reviewed-on: http://gerrit.openafs.org/2618 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit df4cf75b970f72810078fc788e732480dbb7996a) Reviewed-on: http://gerrit.openafs.org/2680 --- diff --git a/src/afs/FBSD/osi_vfsops.c b/src/afs/FBSD/osi_vfsops.c index 3bed07bac..23079f048 100644 --- a/src/afs/FBSD/osi_vfsops.c +++ b/src/afs/FBSD/osi_vfsops.c @@ -20,6 +20,9 @@ int afs_pbuf_freecnt = -1; extern int Afs_xsetgroups(); extern int afs_xioctl(); +#if !defined(AFS_FBSD90_ENV) +static sy_call_t *old_handler; +#else static struct sysent old_sysent; static struct sysent afs_sysent = { @@ -38,32 +41,51 @@ static struct sysent afs_sysent = { #endif #endif /* FBSD60 */ }; +#endif /* FBSD90 */ int afs_init(struct vfsconf *vfc) { int code; int offset = AFS_SYSCALL; - +#if defined(AFS_FBSD90_ENV) code = syscall_register(&offset, &afs_sysent, &old_sysent); if (code) { printf("AFS_SYSCALL in use, error %i. aborting\n", code); return code; } +#else + if (sysent[AFS_SYSCALL].sy_call != nosys + && sysent[AFS_SYSCALL].sy_call != lkmnosys) { + printf("AFS_SYSCALL in use. aborting\n"); + return EBUSY; + } +#endif osi_Init(); afs_pbuf_freecnt = nswbuf / 2 + 1; - +#if !defined(AFS_FBSD90_ENV) + old_handler = sysent[AFS_SYSCALL].sy_call; + sysent[AFS_SYSCALL].sy_call = afs3_syscall; + sysent[AFS_SYSCALL].sy_narg = 5; +#endif return 0; } int afs_uninit(struct vfsconf *vfc) { +#if defined(AFS_FBSD90_ENV) int offset = AFS_SYSCALL; +#endif if (afs_globalVFS) return EBUSY; +#if defined(AFS_FBSD90_ENV) syscall_deregister(&offset, &old_sysent); +#else + sysent[AFS_SYSCALL].sy_narg = 0; + sysent[AFS_SYSCALL].sy_call = old_handler; +#endif return 0; }