From owner-svn-src-all@FreeBSD.ORG Sat Jul 24 22:11:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B90211065670; Sat, 24 Jul 2010 22:11:11 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9AAD8FC0A; Sat, 24 Jul 2010 22:11:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6OMBBQO052119; Sat, 24 Jul 2010 22:11:11 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6OMBBVR052104; Sat, 24 Jul 2010 22:11:11 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201007242211.o6OMBBVR052104@svn.freebsd.org> From: Rick Macklem Date: Sat, 24 Jul 2010 22:11:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210455 - in head/sys: conf fs/nfsclient modules modules/nfscl modules/nfsclient modules/nfslock nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2010 22:11:11 -0000 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 #include #include -#include 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 #include #include -#include #include 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 #include - #include #include #include #include -#include #include #include #include +#include + /* 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 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 #include +#include #include #include #include -#include #include 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 - /* * 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 #include #include -#include +#include 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 #include #include -#include +#include #include #include