Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Jul 2010 22:11:11 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r210455 - in head/sys: conf fs/nfsclient modules modules/nfscl modules/nfsclient modules/nfslock nfs nfsclient
Message-ID:  <201007242211.o6OMBBVR052104@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sat Jul 24 22:11:11 2010
New Revision: 210455
URL: http://svn.freebsd.org/changeset/base/210455

Log:
  Move sys/nfsclient/nfs_lock.c into sys/nfs and build it as a separate
  module that can be used by both the regular and experimental nfs
  clients. This fixes the problem reported by jh@ where /dev/nfslock
  would be registered twice when both nfs clients were used.
  I also defined the size of the lm_fh field to be the correct value,
  as it should be the maximum size of an NFSv3 file handle.
  
  Reviewed by:	jh
  MFC after:	2 weeks

Added:
  head/sys/modules/nfslock/
  head/sys/modules/nfslock/Makefile   (contents, props changed)
  head/sys/nfs/nfs_lock.c
     - copied, changed from r210454, head/sys/nfsclient/nfs_lock.c
  head/sys/nfs/nfs_lock.h
     - copied, changed from r210454, head/sys/nfsclient/nfs_lock.h
Deleted:
  head/sys/fs/nfsclient/nfs_cllock.c
  head/sys/fs/nfsclient/nfs_lock.h
  head/sys/nfsclient/nfs_lock.c
  head/sys/nfsclient/nfs_lock.h
Modified:
  head/sys/conf/files
  head/sys/fs/nfsclient/nfs_clnfsiod.c
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/fs/nfsclient/nfs_clsubs.c
  head/sys/fs/nfsclient/nfs_clvnops.c
  head/sys/modules/Makefile
  head/sys/modules/nfscl/Makefile
  head/sys/modules/nfsclient/Makefile
  head/sys/nfsclient/nfs_nfsiod.c
  head/sys/nfsclient/nfs_vfsops.c
  head/sys/nfsclient/nfs_vnops.c

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Sat Jul 24 19:40:16 2010	(r210454)
+++ head/sys/conf/files	Sat Jul 24 22:11:11 2010	(r210455)
@@ -1914,7 +1914,6 @@ fs/nfsclient/nfs_clrpcops.c	optional nfs
 fs/nfsclient/nfs_clvnops.c	optional nfscl
 fs/nfsclient/nfs_clnode.c	optional nfscl
 fs/nfsclient/nfs_clvfsops.c	optional nfscl
-fs/nfsclient/nfs_cllock.c	optional nfscl
 fs/nfsclient/nfs_clport.c	optional nfscl
 fs/nfsclient/nfs_clbio.c	optional nfscl
 fs/nfsclient/nfs_clnfsiod.c	optional nfscl
@@ -2680,6 +2679,7 @@ netsmb/smb_subr.c		optional netsmb
 netsmb/smb_trantcp.c		optional netsmb
 netsmb/smb_usr.c		optional netsmb
 nfs/nfs_common.c		optional nfsclient | nfsserver
+nfs/nfs_lock.c			optional nfsclient | nfscl
 nfsclient/bootp_subr.c		optional bootp nfsclient
 nfsclient/krpc_subr.c		optional bootp nfsclient
 nfsclient/nfs_bio.c		optional nfsclient
@@ -2690,7 +2690,6 @@ nfsclient/nfs_subs.c		optional nfsclient
 nfsclient/nfs_nfsiod.c		optional nfsclient
 nfsclient/nfs_vfsops.c		optional nfsclient
 nfsclient/nfs_vnops.c		optional nfsclient
-nfsclient/nfs_lock.c		optional nfsclient
 nfsserver/nfs_fha.c		optional nfsserver
 nfsserver/nfs_serv.c		optional nfsserver
 nfsserver/nfs_srvkrpc.c		optional nfsserver

Modified: head/sys/fs/nfsclient/nfs_clnfsiod.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clnfsiod.c	Sat Jul 24 19:40:16 2010	(r210454)
+++ head/sys/fs/nfsclient/nfs_clnfsiod.c	Sat Jul 24 22:11:11 2010	(r210455)
@@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$");
 #include <fs/nfsclient/nfsmount.h>
 #include <fs/nfsclient/nfs.h>
 #include <fs/nfsclient/nfsnode.h>
-#include <fs/nfsclient/nfs_lock.h>
 
 extern struct mtx ncl_iod_mutex;
 

Modified: head/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clport.c	Sat Jul 24 19:40:16 2010	(r210454)
+++ head/sys/fs/nfsclient/nfs_clport.c	Sat Jul 24 22:11:11 2010	(r210455)
@@ -1268,4 +1268,5 @@ MODULE_VERSION(nfscl, 1);
 MODULE_DEPEND(nfscl, nfscommon, 1, 1, 1);
 MODULE_DEPEND(nfscl, krpc, 1, 1, 1);
 MODULE_DEPEND(nfscl, nfssvc, 1, 1, 1);
+MODULE_DEPEND(nfscl, nfslock, 1, 1, 1);
 

Modified: head/sys/fs/nfsclient/nfs_clsubs.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clsubs.c	Sat Jul 24 19:40:16 2010	(r210454)
+++ head/sys/fs/nfsclient/nfs_clsubs.c	Sat Jul 24 22:11:11 2010	(r210455)
@@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$");
 #include <fs/nfsclient/nfsnode.h>
 #include <fs/nfsclient/nfsmount.h>
 #include <fs/nfsclient/nfs.h>
-#include <fs/nfsclient/nfs_lock.h>
 
 #include <netinet/in.h>
 

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvnops.c	Sat Jul 24 19:40:16 2010	(r210454)
+++ head/sys/fs/nfsclient/nfs_clvnops.c	Sat Jul 24 22:11:11 2010	(r210455)
@@ -67,24 +67,24 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_extern.h>
 #include <vm/vm_object.h>
 
-
 #include <fs/nfs/nfsport.h>
 #include <fs/nfsclient/nfsnode.h>
 #include <fs/nfsclient/nfsmount.h>
 #include <fs/nfsclient/nfs.h>
-#include <fs/nfsclient/nfs_lock.h>
 
 #include <net/if.h>
 #include <netinet/in.h>
 #include <netinet/in_var.h>
 
+#include <nfs/nfs_lock.h>
+
 /* Defs */
 #define	TRUE	1
 #define	FALSE	0
 
 extern struct nfsstats newnfsstats;
 MALLOC_DECLARE(M_NEWNFSREQ);
-vop_advlock_t	*ncl_advlock_p = ncl_dolock;
+vop_advlock_t	*ncl_advlock_p = nfs_dolock;
 
 /*
  * Ifdef for FreeBSD-current merged buffer cache. It is unfortunate that these

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Sat Jul 24 19:40:16 2010	(r210454)
+++ head/sys/modules/Makefile	Sat Jul 24 22:11:11 2010	(r210455)
@@ -205,6 +205,7 @@ SUBDIR=	${_3dfx} \
 	nfsclient \
 	nfscommon \
 	nfsd \
+	nfslock \
 	nfslockd \
 	nfsserver \
 	nfssvc \

Modified: head/sys/modules/nfscl/Makefile
==============================================================================
--- head/sys/modules/nfscl/Makefile	Sat Jul 24 19:40:16 2010	(r210454)
+++ head/sys/modules/nfscl/Makefile	Sat Jul 24 22:11:11 2010	(r210455)
@@ -9,7 +9,6 @@ SRCS=	vnode_if.h \
 	nfs_clcomsubs.c \
 	nfs_clport.c \
 	nfs_clbio.c \
-	nfs_cllock.c \
 	nfs_clnfsiod.c \
 	nfs_clnode.c \
 	nfs_clsubs.c \

Modified: head/sys/modules/nfsclient/Makefile
==============================================================================
--- head/sys/modules/nfsclient/Makefile	Sat Jul 24 19:40:16 2010	(r210454)
+++ head/sys/modules/nfsclient/Makefile	Sat Jul 24 22:11:11 2010	(r210455)
@@ -4,7 +4,7 @@
 
 KMOD=	nfsclient
 SRCS=	vnode_if.h \
-	nfs_bio.c nfs_lock.c nfs_node.c nfs_subs.c nfs_nfsiod.c \
+	nfs_bio.c nfs_node.c nfs_subs.c nfs_nfsiod.c \
 	nfs_vfsops.c nfs_vnops.c nfs_krpc.c \
 	opt_inet.h opt_nfs.h opt_bootp.h opt_nfsroot.h
 SRCS+=	opt_inet6.h opt_kdtrace.h opt_kgssapi.h

Added: head/sys/modules/nfslock/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/modules/nfslock/Makefile	Sat Jul 24 22:11:11 2010	(r210455)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../nfs
+KMOD=	nfslock
+SRCS=	vnode_if.h \
+	nfs_lock.c \
+	opt_nfs.h
+
+.include <bsd.kmod.mk>

Copied and modified: head/sys/nfs/nfs_lock.c (from r210454, head/sys/nfsclient/nfs_lock.c)
==============================================================================
--- head/sys/nfsclient/nfs_lock.c	Sat Jul 24 19:40:16 2010	(r210454, copy source)
+++ head/sys/nfs/nfs_lock.c	Sat Jul 24 22:11:11 2010	(r210455)
@@ -54,10 +54,10 @@ __FBSDID("$FreeBSD$");
 #include <net/if.h>
 
 #include <nfs/nfsproto.h>
+#include <nfs/nfs_lock.h>
 #include <nfsclient/nfs.h>
 #include <nfsclient/nfsmount.h>
 #include <nfsclient/nfsnode.h>
-#include <nfsclient/nfs_lock.h>
 #include <nfsclient/nlminfo.h>
 
 extern void (*nlminfo_release_p)(struct proc *p);

Copied and modified: head/sys/nfs/nfs_lock.h (from r210454, head/sys/nfsclient/nfs_lock.h)
==============================================================================
--- head/sys/nfsclient/nfs_lock.h	Sat Jul 24 19:40:16 2010	(r210454, copy source)
+++ head/sys/nfs/nfs_lock.h	Sat Jul 24 22:11:11 2010	(r210455)
@@ -37,8 +37,6 @@
  * If a structure changes, you must bump the version number.
  */
 
-#include <nfs/nfsproto.h>
-
 /*
  * The fifo where the kernel writes requests for locks on remote NFS files,
  * and where lockd reads these requests.
@@ -74,7 +72,7 @@ typedef struct __lock_msg {
 	int			lm_nfsv3;		/* If NFS version 3. */
 	size_t			lm_fh_len;		/* The file handle length. */
 	struct xucred		lm_cred;		/* user cred for lock req */
-	u_int8_t		lm_fh[NFS_SMALLFH];/* The file handle. */
+	u_int8_t		lm_fh[NFSX_V3FHMAX];/* The file handle. */
 } LOCKD_MSG;
 
 #define LOCKD_ANS_VERSION	1

Modified: head/sys/nfsclient/nfs_nfsiod.c
==============================================================================
--- head/sys/nfsclient/nfs_nfsiod.c	Sat Jul 24 19:40:16 2010	(r210454)
+++ head/sys/nfsclient/nfs_nfsiod.c	Sat Jul 24 22:11:11 2010	(r210455)
@@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$");
 #include <nfsclient/nfsm_subs.h>
 #include <nfsclient/nfsmount.h>
 #include <nfsclient/nfsnode.h>
-#include <nfsclient/nfs_lock.h>
+#include <nfs/nfs_lock.h>
 
 static MALLOC_DEFINE(M_NFSSVC, "nfsclient_srvsock", "Nfs server structure");
 

Modified: head/sys/nfsclient/nfs_vfsops.c
==============================================================================
--- head/sys/nfsclient/nfs_vfsops.c	Sat Jul 24 19:40:16 2010	(r210454)
+++ head/sys/nfsclient/nfs_vfsops.c	Sat Jul 24 22:11:11 2010	(r210455)
@@ -148,6 +148,7 @@ MODULE_DEPEND(nfs, krpc, 1, 1, 1);
 MODULE_DEPEND(nfs, kgssapi, 1, 1, 1);
 #endif
 MODULE_DEPEND(nfs, nfs_common, 1, 1, 1);
+MODULE_DEPEND(nfs, nfslock, 1, 1, 1);
 
 static struct nfs_rpcops nfs_rpcops = {
 	nfs_readrpc,

Modified: head/sys/nfsclient/nfs_vnops.c
==============================================================================
--- head/sys/nfsclient/nfs_vnops.c	Sat Jul 24 19:40:16 2010	(r210454)
+++ head/sys/nfsclient/nfs_vnops.c	Sat Jul 24 22:11:11 2010	(r210455)
@@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$");
 #include <nfsclient/nfsnode.h>
 #include <nfsclient/nfsmount.h>
 #include <nfsclient/nfs_kdtrace.h>
-#include <nfsclient/nfs_lock.h>
+#include <nfs/nfs_lock.h>
 #include <nfs/xdr_subs.h>
 #include <nfsclient/nfsm_subs.h>
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007242211.o6OMBBVR052104>