]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Fix build for FreeBSD 10.0
authorBenjamin Kaduk <kaduk@mit.edu>
Wed, 25 Sep 2013 20:57:41 +0000 (16:57 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 31 Oct 2013 17:21:22 +0000 (10:21 -0700)
Move a rmlock.h inclusion up a bit so that the vm headers can get the
rmlock assertion (and other) macros they need.

The filedesc structure has been expanded on FreeBSD to support a
stronger capabilities system; getting to the actual file descriptor
requires another structure access.

limits.h and stdarg.h need sys/ and machine/ prefixes for inclusion in the
kernel on FreeBSD.  Unlike on master, there are not spurious include search
path directives to remove.

Catch up to VM layer changes.

This builds, but crashes at runtime due to some ABI incompatibilities
that appear in the rx event layer; those will be fixed in a separate patch.

Reviewed-on: http://gerrit.openafs.org/10339
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit e222b08c4049dae95475eda2d5c54bd43dd45e2e)

Change-Id: Ia8f0f31b000292fd160b8752ad5839852e11f0e0
Reviewed-on: http://gerrit.openafs.org/10379
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afs/FBSD/osi_vm.c
src/afs/FBSD/osi_vnodeops.c
src/afs/afs_pioctl.c
src/afs/afs_warn.c
src/afs/sysincludes.h
src/rx/rx_kcommon.h

index 8f4c4b5bed50fe5bd6e50e23a1c8d82050673d8c..65f53334b210e83fcf1d160e585376bb7907e39a 100644 (file)
@@ -29,7 +29,7 @@
 #include "afs/afs_stats.h"     /* statistics */
 #include <vm/vm_object.h>
 #include <vm/vm_map.h>
-#include <limits.h>
+#include <sys/limits.h>
 #if __FreeBSD_version >= 1000030
 #include <sys/rwlock.h>
 #endif
index 32c56647b5324812aced3ec7cae34bd6d9d7b30d..ac16df034b4080bf898ac91e5d46854d68351450 100644 (file)
 #include <sys/malloc.h>
 #include <sys/namei.h>
 #include <sys/unistd.h>
-#include <vm/vm_page.h>
-#include <vm/vm_object.h>
-#include <vm/vm_pager.h>
 #if __FreeBSD_version >= 1000030
 #include <sys/rwlock.h>
 #endif
+#include <vm/vm_page.h>
+#include <vm/vm_object.h>
+#include <vm/vm_pager.h>
 #include <vm/vnode_pager.h>
 extern int afs_pbuf_freecnt;
 
@@ -904,6 +904,9 @@ afs_vop_getpages(struct vop_getpages_args *ap)
        }
 
        if (i != ap->a_reqpage) {
+#if __FreeBSD_version >= 1000042
+           vm_page_readahead_finish(m);
+#else
            /*
             * Whether or not to leave the page activated is up in
             * the air, but we should put the page on a page queue
@@ -937,6 +940,7 @@ afs_vop_getpages(struct vop_getpages_args *ap)
                vm_page_free(m);
                ma_vm_page_unlock(m);
            }
+#endif /* __FreeBSD_version 1000042 */
        }
     }
     ma_vm_page_unlock_queues();
index 63fe88f0b1dbf070eed8d483ab9729d1be9ef872..9787950cdbb09f733f52ae66b9125d3306a08c84 100644 (file)
@@ -815,9 +815,15 @@ afs_xioctl(afs_proc_t *p, struct ioctl_args *uap, register_t *retval)
 #   else
     fdp = p->p_fd;
 #endif
+#if defined(AFS_FBSD100_ENV)
+    if ((uap->fd >= fdp->fd_nfiles)
+       || ((fd = fdp->fd_ofiles[uap->fd].fde_file) == NULL))
+       return EBADF;
+#else
     if ((u_int) uap->fd >= fdp->fd_nfiles
        || (fd = fdp->fd_ofiles[uap->fd]) == NULL)
        return EBADF;
+#endif
     if ((fd->f_flag & (FREAD | FWRITE)) == 0)
        return EBADF;
     /* first determine whether this is any sort of vnode */
index d8bdddc01ecec79577c3eb7635c70b7430ba7591..a04a98b7e70f8c376634f89904a5529fff214f8b 100644 (file)
@@ -25,6 +25,8 @@
 # include <net/if.h>
 # if defined(AFS_SUN58_ENV)
 #  include <sys/varargs.h>
+# elif defined(AFS_FBSD_ENV)
+#  include <machine/stdarg.h>
 # else
 #  include <stdarg.h>
 # endif
index 5840227130266e8102c67dff1f22c0f8a882403f..9d68b1eb95b43e3c3fea9fe9fb0c8886bea21885 100644 (file)
@@ -288,7 +288,7 @@ typedef unsigned short etap_event_t;
 # include "h/protosw.h"
 
 # if defined(AFS_FBSD_ENV)
-#  include "limits.h"
+#  include "sys/limits.h"
 # endif
 
 # ifdef AFS_HPUX_ENV
index 64d03cbb444b5a6b9f14bf76183ab302d8ee5454..58bf69cdb8a7f40fc6cce6d96c72830cec01b3a7 100644 (file)
@@ -141,7 +141,11 @@ typedef unsigned short etap_event_t;
 #include "h/errno.h"
 #if !(defined(AFS_SUN5_ENV) && defined(KERNEL))
 /* if sys/systm.h includes varargs.h some versions of solaris have conflicts */
-#include "stdarg.h"
+# if defined(AFS_FBSD_ENV)
+#  include "machine/stdarg.h"
+# else
+#  include "stdarg.h"
+# endif
 #endif
 #ifdef KERNEL
 #include "afs/sysincludes.h"