afs: Do not supply bogus poll vnodeops for FBSD
[openafs.git] / src / afs / FBSD / osi_vfsops.c
index b300ff4..5b3f33b 100644 (file)
@@ -49,14 +49,18 @@ afs_init(struct vfsconf *vfc)
     int code;
     int offset = AFS_SYSCALL;
 #if defined(AFS_FBSD90_ENV) || defined(AFS_FBSD82_ENV)
+# if defined(FBSD_SYSCALL_REGISTER_FOUR_ARGS)
+    code = syscall_register(&offset, &afs_sysent, &old_sysent, 0);
+# else
     code = syscall_register(&offset, &afs_sysent, &old_sysent);
+# endif
     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) {
+    if (sysent[AFS_SYSCALL].sy_call != (sy_call_t *)nosys
+        && sysent[AFS_SYSCALL].sy_call != (sy_call_t *)lkmnosys) {
         printf("AFS_SYSCALL in use. aborting\n");
         return EBUSY;
     }
@@ -135,7 +139,9 @@ afs_omount(struct mount *mp, char *path, caddr_t data, struct nameidata *ndp,
 #if defined(AFS_FBSD61_ENV) && !defined(AFS_FBSD62_ENV)
     MNT_ILOCK(mp);
 #endif
+#if __FreeBSD_version < 1000021
     mp->mnt_kern_flag |= MNTK_MPSAFE; /* solid steel */
+#endif
 #ifndef AFS_FBSD61_ENV
     MNT_ILOCK(mp);
 #endif
@@ -183,7 +189,9 @@ afs_mount(struct mount *mp, struct thread *td)
 
 #ifdef AFS_FBSD60_ENV
 static int
-#ifdef AFS_FBSD80_ENV
+#if (__FreeBSD_version >= 900503 && __FreeBSD_version < 1000000) || __FreeBSD_version >= 1000004
+afs_cmount(struct mntarg *ma, void *data, uint64_t flags)
+#elif defined(AFS_FBSD80_ENV)
 afs_cmount(struct mntarg *ma, void *data, int flags)
 #else
 afs_cmount(struct mntarg *ma, void *data, int flags, struct thread *td)
@@ -334,12 +342,8 @@ afs_statfs(struct mount *mp, struct statfs *abp, struct thread *p)
     abp->f_bsize = mp->vfs_bsize;
     abp->f_iosize = mp->vfs_bsize;
 
-    /* Fake a high number below to satisfy programs that use the statfs call
-     * to make sure that there's enough space in the device partition before
-     * storing something there.
-     */
     abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
-       abp->f_ffree = 2000000;
+       abp->f_ffree = AFS_VFS_FAKEFREE;
 
     abp->f_fsid.val[0] = mp->mnt_stat.f_fsid.val[0];
     abp->f_fsid.val[1] = mp->mnt_stat.f_fsid.val[1];