--- nfs/syscalls.c.orig	Tue Jun 30 14:24:56 1998
+++ nfs/syscalls.c	Sat May  1 14:30:02 2004
@@ -12,8 +12,10 @@
 #define NFSCLIENT
 #include "syshdr.h"
 #include <rpc/rpc.h>
-#if !(defined HP || defined IRIX)
+#if !(defined HP || defined IRIX || __FreeBSD_version >= 501113) 
 #include "nfs_prot.h"
+#else
+#include <nfs/nfsproto.h>
 #endif
 #include <netdb.h>
 #include <arpa/inet.h>
@@ -56,7 +58,16 @@
 #define NFSX_V2FH 32
 #ifdef BSD4_4_LITE2
 #	include <nfs/rpcv2.h>
-#	include <nfs/nfs.h>
+#	if (__FreeBSD_version >= 500024)
+#
+#		/* XXX __FreeBSD_version 500024 is the closest we have to the
+#		   NFS reorganization that took place 2001-09-18. This leaves
+#		   a 2 week window. */
+#
+#		include <nfsclient/nfs.h>
+#	else
+#		include <nfs/nfs.h>
+#	endif
 #endif
 int	syscall_mount(char *dir, void *root_fh, int sock_fd,
 									struct sockaddr_in *socket, char *mntfrom)
@@ -103,6 +114,8 @@
 #		define VFCERROR		!vfc
 #		define VFCNFSNAME	vfc->vfc_index
 #	endif
+
+#if __FreeBSD_version < 502111
 	GETVFSBYNAME;
 	if (VFCERROR && vfsisloadable("nfs")) {
 		if(vfsload("nfs"))
@@ -112,6 +125,7 @@
 	}
 	if (VFCERROR)
 		return -1;
+#endif
 	return mount(VFCNFSNAME, dir, 0, &nfs_args);
 #else	/* __FreeBSD__ */
 	return mount(NFSNAME, dir, 0, &nfs_args);
