Diffs for NetBSD-current up through 3.99.10

Ty Sarna tsarna at sarna.org
Fri Jan 20 17:30:10 CET 2006


The following patch makes 0.41 compile and work with NetBSD-current up
through 3.99.10 (2005-11-01 and earlier).

Changes:
	- Deal with some struct vfsops changes.

	- fix typo that prevented building for NetBSD (and some other
	  platforms) with --enable-smp. Unfortunately, even with this
	  fix the resulting arla doesn't work right -- hangs the system in
	  arlad.

	- For some reason the existance of the vfsops "checkexp" method
	  is used to determine the calling signature of the fhtovp
	  method. All versions of NetBSD have the "new" signature, but
	  when checkexp was removed from netbsd, arla suddenly decided
	  it must have the old signature. I changed the test to always
	  use the new signature for NetBSD, but you may want to correct
	  it to not use checkexp for other systems. Maybe there is
	  autoconf magic that can help. I will leave that to you.


(Run autoconf after patch, I didn't include configure diffs)


diff -ur arla-0.41/configure.in arla-0.41-ty1/configure.in
--- arla-0.41/configure.in	2005-11-30 10:22:02.000000000 -0500
+++ arla-0.41-ty1/configure.in	2006-01-18 10:57:21.000000000 -0500
@@ -82,7 +82,7 @@
 AC_FUNC_NTOHL
 
 AC_ARG_ENABLE(smp,
-[  --enable-smp            compile for SMP (for Linux and FreeBSD)],
+[  --enable-smp            compile for SMP (for Linux, FreeBSD, NetBSD)],
 [if test "$enableval" = "yes"; then
   smp="-DSMP -DCONFIG_SMP"
 else
@@ -364,7 +364,7 @@
 
   KERNEL_CPPFLAGS="$KERNEL_CPPFLAGS -I`pwd`/include/netbsd-lkm"
 
-  if test "X$smp" != "Xno" -a "X$xmp" != "X"; then
+  if test "X$smp" != "Xno" -a "X$smp" != "X"; then
   	KERNEL_CPPFLAGS="$KERNEL_CPPFLAGS -DMULTIPROCESSOR"
   fi
 
@@ -378,7 +378,7 @@
   KERNEL=/kernel
   MODULE=nnpfs.ko
 
-  if test "X$smp" != "Xno" -a "X$xmp" != "X"; then
+  if test "X$smp" != "Xno" -a "X$smp" != "X"; then
         smp="-DAPIC_IO $smp"
   else
         smp=""
@@ -463,7 +463,7 @@
 	if test "X$kld" = "X"; then
 		kld="yes";
 	fi
-	if test "X$smp" != "Xno" -a "X$xmp" != "X"; then
+	if test "X$smp" != "Xno" -a "X$smp" != "X"; then
 		smp="-DAPIC_IO $smp"
 	else
 		smp=""
@@ -1682,6 +1682,24 @@
 ],
 vfsops,
 void *,
+vfs_sysctl)
+
+AC_HAVE_KERNEL_STRUCT_FIELD([
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/mount.h>
+],
+vfsops,
+void *,
+vfs_wassysctl)
+
+AC_HAVE_KERNEL_STRUCT_FIELD([
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/mount.h>
+],
+vfsops,
+void *,
 vfs_extattrctl)
 
 AC_HAVE_KERNEL_STRUCT_FIELD([
diff -ur arla-0.41/include/config.h.in arla-0.41-ty1/include/config.h.in
--- arla-0.41/include/config.h.in	2005-12-01 07:13:36.000000000 -0500
+++ arla-0.41-ty1/include/config.h.in	2006-01-18 11:00:41.000000000 -0500
@@ -1006,6 +1006,12 @@
 /* Define if struct vfsops has field vfs_checkexp */
 #undef HAVE_STRUCT_VFSOPS_VFS_CHECKEXP
 
+/* Define if struct vfsops has field vfs_sysctl */
+#undef HAVE_STRUCT_VFSOPS_VFS_SYSCTL
+
+/* Define if struct vfsops has field vfs_wassysctl */
+#undef HAVE_STRUCT_VFSOPS_VFS_WASSYSCTL
+
 /* Define if struct vfsops has field vfs_done */
 #undef HAVE_STRUCT_VFSOPS_VFS_DONE
 
diff -ur arla-0.41/nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h arla-0.41-ty1/nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h
--- arla-0.41/nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h	2005-10-28 10:33:40.000000000 -0400
+++ arla-0.41-ty1/nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h	2006-01-18 11:27:24.000000000 -0500
@@ -99,7 +99,7 @@
 struct mbuf;
 struct fid;
 
-#ifdef HAVE_STRUCT_VFSOPS_VFS_CHECKEXP
+#if defined(HAVE_STRUCT_VFSOPS_VFS_CHECKEXP) || defined (__NetBSD__)
 int
 nnpfs_fhtovp(struct mount * mp,
 	     struct fid * fhp,
diff -ur arla-0.41/nnpfs/bsd/nnpfs_vfsops-bsd.c arla-0.41-ty1/nnpfs/bsd/nnpfs_vfsops-bsd.c
--- arla-0.41/nnpfs/bsd/nnpfs_vfsops-bsd.c	2005-11-21 06:25:40.000000000 -0500
+++ arla-0.41-ty1/nnpfs/bsd/nnpfs_vfsops-bsd.c	2006-01-18 11:35:02.000000000 -0500
@@ -211,7 +211,7 @@
 
 /* new style fhtovp */
 
-#ifdef HAVE_STRUCT_VFSOPS_VFS_CHECKEXP
+#if defined(HAVE_STRUCT_VFSOPS_VFS_CHECKEXP) || defined(__NetBSD__)
 int
 nnpfs_fhtovp(struct mount * mp,
 	   struct fid * fhp,
diff -ur arla-0.41/nnpfs/bsd/nnpfs_vfsops-netbsd.c arla-0.41-ty1/nnpfs/bsd/nnpfs_vfsops-netbsd.c
--- arla-0.41/nnpfs/bsd/nnpfs_vfsops-netbsd.c	2005-10-28 10:33:39.000000000 -0400
+++ arla-0.41-ty1/nnpfs/bsd/nnpfs_vfsops-netbsd.c	2006-01-18 10:55:26.000000000 -0500
@@ -186,7 +186,12 @@
 #ifdef HAVE_STRUCT_VFSOPS_VFS_DONE
     nnpfs_done,
 #endif
+#if defined(HAVE_STRUCT_VFSOPS_VFS_SYSCTL)
     NULL,			/* sysctl */
+#endif
+#if defined(HAVE_STRUCT_VFSOPS_VFS_WASSYSCTL)
+    NULL,			/* wassysctl */
+#endif
     NULL,			/* mountroot */
 #ifdef HAVE_STRUCT_VFSOPS_VFS_CHECKEXP
     nnpfs_checkexp,		/* checkexp */



More information about the Arla-drinkers mailing list