From 3be2222bbe56192eb75b39905cef98ac451a3d70 Mon Sep 17 00:00:00 2001 From: pgoyette Date: Tue, 13 Dec 2016 22:17:33 +0000 Subject: [PATCH] Adapt code for our location of the nfs headers, and some updates for differences in kernel options(4) handling --- sys/fs/nfs/client/nfs_clkrpc.c | 8 +++++--- sys/fs/nfs/client/nfs_clnfsiod.c | 12 ++++++------ sys/fs/nfs/client/nfs_clnode.c | 16 ++++++++-------- sys/fs/nfs/client/nfs_clport.c | 12 ++++++++---- sys/fs/nfs/client/nfs_clrpcops.c | 8 +++++--- sys/fs/nfs/client/nfs_clstate.c | 6 +++--- sys/fs/nfs/client/nfs_clsubs.c | 14 +++++++------- sys/fs/nfs/client/nfs_clvfsops.c | 25 +++++++++++++------------ sys/fs/nfs/client/nfs_clvnops.c | 19 +++++++++++-------- sys/fs/nfs/client/nfsmount.h | 6 +++--- sys/fs/nfs/client/nfsnode.h | 6 +++--- 11 files changed, 72 insertions(+), 60 deletions(-) diff --git a/sys/fs/nfs/client/nfs_clkrpc.c b/sys/fs/nfs/client/nfs_clkrpc.c index a68a939ff698..50a5ddb0cd19 100644 --- a/sys/fs/nfs/client/nfs_clkrpc.c +++ b/sys/fs/nfs/client/nfs_clkrpc.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_clkrpc.c,v 1.1.1.1 2013/09/30 07:19:04 dholland Exp $ */ +/* $NetBSD: nfs_clkrpc.c,v 1.2 2016/12/13 22:17:33 pgoyette Exp $ */ /*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -34,11 +34,13 @@ #include /* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clkrpc.c 255216 2013-09-04 22:47:56Z rmacklem "); */ -__RCSID("$NetBSD: nfs_clkrpc.c,v 1.1.1.1 2013/09/30 07:19:04 dholland Exp $"); +__RCSID("$NetBSD: nfs_clkrpc.c,v 1.2 2016/12/13 22:17:33 pgoyette Exp $"); +#ifdef NOTYET /* _KERNEL_OPT */ #include "opt_kgssapi.h" +#endif -#include +#include #include #include diff --git a/sys/fs/nfs/client/nfs_clnfsiod.c b/sys/fs/nfs/client/nfs_clnfsiod.c index 3f109f6d5c67..3b0d2eded4e5 100644 --- a/sys/fs/nfs/client/nfs_clnfsiod.c +++ b/sys/fs/nfs/client/nfs_clnfsiod.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_clnfsiod.c,v 1.1.1.1 2013/09/30 07:19:30 dholland Exp $ */ +/* $NetBSD: nfs_clnfsiod.c,v 1.2 2016/12/13 22:17:33 pgoyette Exp $ */ /*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +35,7 @@ #include /* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clnfsiod.c 249630 2013-04-18 23:20:16Z rmacklem "); */ -__RCSID("$NetBSD: nfs_clnfsiod.c,v 1.1.1.1 2013/09/30 07:19:30 dholland Exp $"); +__RCSID("$NetBSD: nfs_clnfsiod.c,v 1.2 2016/12/13 22:17:33 pgoyette Exp $"); #include #include @@ -66,10 +66,10 @@ __RCSID("$NetBSD: nfs_clnfsiod.c,v 1.1.1.1 2013/09/30 07:19:30 dholland Exp $"); #include #include -#include -#include -#include -#include +#include +#include +#include +#include extern struct mtx ncl_iod_mutex; extern struct task ncl_nfsiodnew_task; diff --git a/sys/fs/nfs/client/nfs_clnode.c b/sys/fs/nfs/client/nfs_clnode.c index 5088d6dbc0a7..373e9f26e651 100644 --- a/sys/fs/nfs/client/nfs_clnode.c +++ b/sys/fs/nfs/client/nfs_clnode.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_clnode.c,v 1.2 2016/11/18 22:58:08 pgoyette Exp $ */ +/* $NetBSD: nfs_clnode.c,v 1.3 2016/12/13 22:17:33 pgoyette Exp $ */ /*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +35,7 @@ #include /* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clnode.c 302210 2016-06-26 14:18:28Z kib "); */ -__RCSID("$NetBSD: nfs_clnode.c,v 1.2 2016/11/18 22:58:08 pgoyette Exp $"); +__RCSID("$NetBSD: nfs_clnode.c,v 1.3 2016/12/13 22:17:33 pgoyette Exp $"); #include #include @@ -52,13 +52,13 @@ __RCSID("$NetBSD: nfs_clnode.c,v 1.2 2016/11/18 22:58:08 pgoyette Exp $"); #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include +#include extern struct vop_vector newnfs_vnodeops; extern struct buf_ops buf_ops_newnfs; diff --git a/sys/fs/nfs/client/nfs_clport.c b/sys/fs/nfs/client/nfs_clport.c index c63cea8c9f68..2189a86f36f6 100644 --- a/sys/fs/nfs/client/nfs_clport.c +++ b/sys/fs/nfs/client/nfs_clport.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_clport.c,v 1.1.1.2 2016/11/18 07:49:11 pgoyette Exp $ */ +/* $NetBSD: nfs_clport.c,v 1.2 2016/12/13 22:17:33 pgoyette Exp $ */ /*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -34,10 +34,12 @@ #include /* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clport.c 299413 2016-05-11 06:35:46Z kib "); */ -__RCSID("$NetBSD: nfs_clport.c,v 1.1.1.2 2016/11/18 07:49:11 pgoyette Exp $"); +__RCSID("$NetBSD: nfs_clport.c,v 1.2 2016/12/13 22:17:33 pgoyette Exp $"); +#ifdef _KERNEL_OPT #include "opt_inet.h" #include "opt_inet6.h" +#endif #include @@ -46,15 +48,17 @@ __RCSID("$NetBSD: nfs_clport.c,v 1.1.1.2 2016/11/18 07:49:11 pgoyette Exp $"); * be the easiest way to handle the port. */ #include + #include #include -#include +#include + #include #include #include #include -#include +#include #ifdef KDTRACE_HOOKS dtrace_nfsclient_attrcache_flush_probe_func_t diff --git a/sys/fs/nfs/client/nfs_clrpcops.c b/sys/fs/nfs/client/nfs_clrpcops.c index b60e98b7830b..2a5a84f2ebc8 100644 --- a/sys/fs/nfs/client/nfs_clrpcops.c +++ b/sys/fs/nfs/client/nfs_clrpcops.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_clrpcops.c,v 1.1.1.2 2016/11/18 07:49:11 pgoyette Exp $ */ +/* $NetBSD: nfs_clrpcops.c,v 1.2 2016/12/13 22:17:33 pgoyette Exp $ */ /*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -34,7 +34,7 @@ #include /* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clrpcops.c 298788 2016-04-29 16:07:25Z pfg "); */ -__RCSID("$NetBSD: nfs_clrpcops.c,v 1.1.1.2 2016/11/18 07:49:11 pgoyette Exp $"); +__RCSID("$NetBSD: nfs_clrpcops.c,v 1.2 2016/12/13 22:17:33 pgoyette Exp $"); /* * Rpc op calls, generally called from the vnode op calls or through the @@ -45,9 +45,11 @@ __RCSID("$NetBSD: nfs_clrpcops.c,v 1.1.1.2 2016/11/18 07:49:11 pgoyette Exp $"); */ #ifndef APPLEKEXT +#ifdef _KERNEL_OPT #include "opt_inet6.h" +#endif -#include +#include #include SYSCTL_DECL(_vfs_nfs); diff --git a/sys/fs/nfs/client/nfs_clstate.c b/sys/fs/nfs/client/nfs_clstate.c index ac4911d57bba..8343ccb075a2 100644 --- a/sys/fs/nfs/client/nfs_clstate.c +++ b/sys/fs/nfs/client/nfs_clstate.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_clstate.c,v 1.3 2016/11/18 08:31:30 pgoyette Exp $ */ +/* $NetBSD: nfs_clstate.c,v 1.4 2016/12/13 22:17:33 pgoyette Exp $ */ /*- * Copyright (c) 2009 Rick Macklem, University of Guelph * All rights reserved. @@ -28,7 +28,7 @@ #include /* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clstate.c 304026 2016-08-12 22:44:59Z rmacklem "); */ -__RCSID("$NetBSD: nfs_clstate.c,v 1.3 2016/11/18 08:31:30 pgoyette Exp $"); +__RCSID("$NetBSD: nfs_clstate.c,v 1.4 2016/12/13 22:17:33 pgoyette Exp $"); /* * These functions implement the client side state handling for NFSv4. @@ -81,7 +81,7 @@ __RCSID("$NetBSD: nfs_clstate.c,v 1.3 2016/11/18 08:31:30 pgoyette Exp $"); */ #ifndef APPLEKEXT -#include +#include /* * Global variables diff --git a/sys/fs/nfs/client/nfs_clsubs.c b/sys/fs/nfs/client/nfs_clsubs.c index 0b7a374e6a12..0f9b68137ac6 100644 --- a/sys/fs/nfs/client/nfs_clsubs.c +++ b/sys/fs/nfs/client/nfs_clsubs.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_clsubs.c,v 1.1.1.2 2016/11/18 07:49:10 pgoyette Exp $ */ +/* $NetBSD: nfs_clsubs.c,v 1.2 2016/12/13 22:17:33 pgoyette Exp $ */ /*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +35,7 @@ #include /* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clsubs.c 304026 2016-08-12 22:44:59Z rmacklem "); */ -__RCSID("$NetBSD: nfs_clsubs.c,v 1.1.1.2 2016/11/18 07:49:10 pgoyette Exp $"); +__RCSID("$NetBSD: nfs_clsubs.c,v 1.2 2016/12/13 22:17:33 pgoyette Exp $"); /* * These functions support the macros and help fiddle mbuf chains for @@ -66,11 +66,11 @@ __RCSID("$NetBSD: nfs_clsubs.c,v 1.1.1.2 2016/11/18 07:49:10 pgoyette Exp $"); #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/sys/fs/nfs/client/nfs_clvfsops.c b/sys/fs/nfs/client/nfs_clvfsops.c index 18a71f6ddf3d..c65f5db0903e 100644 --- a/sys/fs/nfs/client/nfs_clvfsops.c +++ b/sys/fs/nfs/client/nfs_clvfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_clvfsops.c,v 1.1.1.2 2016/11/18 07:49:11 pgoyette Exp $ */ +/* $NetBSD: nfs_clvfsops.c,v 1.2 2016/12/13 22:17:33 pgoyette Exp $ */ /*- * Copyright (c) 1989, 1993, 1995 * The Regents of the University of California. All rights reserved. @@ -35,11 +35,12 @@ #include /* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clvfsops.c 304026 2016-08-12 22:44:59Z rmacklem "); */ -__RCSID("$NetBSD: nfs_clvfsops.c,v 1.1.1.2 2016/11/18 07:49:11 pgoyette Exp $"); +__RCSID("$NetBSD: nfs_clvfsops.c,v 1.2 2016/12/13 22:17:33 pgoyette Exp $"); -#include "opt_bootp.h" -#include "opt_nfsroot.h" +#ifdef _KERNEL_OPT +#include "opt_newnfs.h" +#endif #include #include @@ -70,11 +71,11 @@ __RCSID("$NetBSD: nfs_clvfsops.c,v 1.1.1.2 2016/11/18 07:49:11 pgoyette Exp $"); #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include FEATURE(nfscl, "NFSv4 client"); @@ -158,7 +159,7 @@ MODULE_DEPEND(nfs, nfslock, 1, 1, 1); * will be defined for kernels built without NFS_ROOT, although it * isn't used in that case. */ -#if !defined(NFS_ROOT) +#if !defined(NEW_NFS_BOOT) struct nfs_diskless nfs_diskless = { { { 0 } } }; struct nfsv3_diskless nfsv3_diskless = { { { 0 } } }; int nfs_diskless_valid = 0; @@ -405,9 +406,9 @@ nfs_mountroot(struct mount *mp) char buf[128]; char *cp; -#if defined(BOOTP_NFSROOT) && defined(BOOTP) +#if defined(NEW_NFS_BOOT) && defined(NEW_NFS_BOOT_BOOTP) bootpc_init(); /* use bootp to get nfs_diskless filled in */ -#elif defined(NFS_ROOT) +#elif defined(NEW_NFS_BOOT) nfs_setup_diskless(); #endif diff --git a/sys/fs/nfs/client/nfs_clvnops.c b/sys/fs/nfs/client/nfs_clvnops.c index 1906fe9407c9..0de9366cd32a 100644 --- a/sys/fs/nfs/client/nfs_clvnops.c +++ b/sys/fs/nfs/client/nfs_clvnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_clvnops.c,v 1.3 2016/11/18 08:31:30 pgoyette Exp $ */ +/* $NetBSD: nfs_clvnops.c,v 1.4 2016/12/13 22:17:33 pgoyette Exp $ */ /*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -35,13 +35,16 @@ #include /* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clvnops.c 304026 2016-08-12 22:44:59Z rmacklem "); */ -__RCSID("$NetBSD: nfs_clvnops.c,v 1.3 2016/11/18 08:31:30 pgoyette Exp $"); +__RCSID("$NetBSD: nfs_clvnops.c,v 1.4 2016/12/13 22:17:33 pgoyette Exp $"); /* * vnode op calls for Sun NFS version 2, 3 and 4 */ +#ifdef _KERNEL_OPT +#include "opt_dtrace.h" #include "opt_inet.h" +#endif #include #include @@ -68,17 +71,17 @@ __RCSID("$NetBSD: nfs_clvnops.c,v 1.3 2016/11/18 08:31:30 pgoyette Exp $"); #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include -#include +#include #ifdef KDTRACE_HOOKS #include diff --git a/sys/fs/nfs/client/nfsmount.h b/sys/fs/nfs/client/nfsmount.h index 6433eaa226b6..47f51cbbad10 100644 --- a/sys/fs/nfs/client/nfsmount.h +++ b/sys/fs/nfs/client/nfsmount.h @@ -1,4 +1,4 @@ -/* $NetBSD: nfsmount.h,v 1.2 2016/11/18 22:58:08 pgoyette Exp $ */ +/* $NetBSD: nfsmount.h,v 1.3 2016/12/13 22:17:33 pgoyette Exp $ */ /*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -31,13 +31,13 @@ * SUCH DAMAGE. * * FreeBSD: head/sys/fs/nfsclient/nfsmount.h 244042 2012-12-08 22:52:39Z rmacklem - * $NetBSD: nfsmount.h,v 1.2 2016/11/18 22:58:08 pgoyette Exp $ + * $NetBSD: nfsmount.h,v 1.3 2016/12/13 22:17:33 pgoyette Exp $ */ #ifndef _NFSCLIENT_NFSMOUNT_H_ #define _NFSCLIENT_NFSMOUNT_H_ -#include +#include /* * Mount structure. diff --git a/sys/fs/nfs/client/nfsnode.h b/sys/fs/nfs/client/nfsnode.h index 97be6a3aa2a6..f572be64787e 100644 --- a/sys/fs/nfs/client/nfsnode.h +++ b/sys/fs/nfs/client/nfsnode.h @@ -1,4 +1,4 @@ -/* $NetBSD: nfsnode.h,v 1.2 2016/11/18 22:58:08 pgoyette Exp $ */ +/* $NetBSD: nfsnode.h,v 1.3 2016/12/13 22:17:33 pgoyette Exp $ */ /*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * FreeBSD: head/sys/fs/nfsclient/nfsnode.h 303715 2016-08-03 15:58:20Z kib - * $NetBSD: nfsnode.h,v 1.2 2016/11/18 22:58:08 pgoyette Exp $ + * $NetBSD: nfsnode.h,v 1.3 2016/12/13 22:17:33 pgoyette Exp $ */ #ifndef _NFSCLIENT_NFSNODE_H_ @@ -90,7 +90,7 @@ struct nfs_accesscache { * be well aligned and, therefore, tightly packed. */ struct nfsnode { - struct mtx n_mtx; /* Protects all of these members */ + kmutex_t n_mtx; /* Protects all of these members */ u_quad_t n_size; /* Current size of file */ u_quad_t n_brev; /* Modify rev when cached */ u_quad_t n_lrev; /* Modify rev for lease */