]> 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)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 25 Oct 2013 23:50:32 +0000 (16:50 -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.  Fixing this lets us get rid of some unnecessary -I
arguemnts in the kernel module build, which seem to have not been functioning
as expected, anyway.

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.

Change-Id: Icc253b1e938a58a7ab8d1b789c82b9b940d263fd
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>
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/libafs/MakefileProto.FBSD.in
src/rx/rx_kcommon.h

index 8de7f1036af8961cd138cbd5c87ca640d51fcf91..d5d56f72167193aafea890368b3e963a6abd327a 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 936509007bc6d26402eb76251d4f2269e2c6b5c1..9797249f05546627797d9197af5218cca8e70fc4 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 cde09d790e301fd709a46ce79219a76b359b322f..7f0329adff6a13c688b746c6243918f329543d0b 100644 (file)
@@ -820,6 +820,10 @@ afs_xioctl(afs_proc_t *p, const struct ioctl_args *uap, register_t *retval)
 #if defined(AFS_NBSD50_ENV)
     if ((fd = fd_getfile(SCARG(uap, fd))) == NULL)
        return (EBADF);
+#elif defined(AFS_FBSD100_ENV)
+    if ((uap->fd >= fdp->fd_nfiles)
+       || ((fd = fdp->fd_ofiles[uap->fd].fde_file) == NULL))
+       return EBADF;
 #else
     if ((uap->fd >= fdp->fd_nfiles)
        || ((fd = fdp->fd_ofiles[uap->fd]) == NULL))
index 834a84839736923f2a4f14ab6eeaf7ffd28f3eca..92cb5f7478c4d86340c682a4360f7389670310b6 100644 (file)
@@ -25,6 +25,8 @@
 # include <net/if.h>
 # if defined(AFS_SUN5_ENV)
 #  include <sys/varargs.h>
+# elif defined(AFS_FBSD_ENV)
+#  include <machine/stdarg.h>
 # else
 #  include <stdarg.h>
 # endif
index 34501b5585f7eea00d64520ec79e9223cc491774..3e3a1725197d1015c6314dfecc9f6fe69992fa49 100644 (file)
@@ -279,7 +279,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 a3f2bffcba19369f3e4fe9a5b618b8430300aaac..22fd09f6b7fb42e644bed0e63c557b2a39e70ce0 100644 (file)
@@ -94,7 +94,7 @@ OBJS= ${AFSAOBJS} ${AFSNONFSOBJS}
 
 LIBAFSNONFS=   libafs.ko
 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
-CFLAGS+= $(DEFINES) ${COMMON_INCLUDE} -I@/sys -Imachine
+CFLAGS+= $(DEFINES) ${COMMON_INCLUDE}
 
 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
index 9133045a5b8ef2e00fc441d89a4d0e8ee8c6b30e..9b04123856fefa198befaad54d2cf35c732cb611 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"