svn commit: r359745 - in head/sys: conf fs/nfs fs/nfsclient fs/nfsserver kern modules modules/nfslock nfs nlm sys

Rick Macklem rmacklem at FreeBSD.org
Thu Apr 9 14:44:49 UTC 2020


Author: rmacklem
Date: Thu Apr  9 14:44:46 2020
New Revision: 359745
URL: https://svnweb.freebsd.org/changeset/base/359745

Log:
  Remove the old NFS lock device driver that uses Giant.
  
  This NFS lock device driver was replaced by the kernel NLM around FreeBSD7 and
  has not normally been used since then.
  To use it, the kernel had to be built without "options NFSLOCKD" and
  the nfslockd.ko had to be deleted as well.
  Since it uses Giant and is no longer used, this patch removes it.
  
  With this device driver removed, there is now a lot of unused code
  in the userland rpc.lockd. That will be removed on a future commit.
  
  Reviewed by:	kib
  Differential Revision:	https://reviews.freebsd.org/D22933

Deleted:
  head/sys/modules/nfslock/
  head/sys/nfs/nfs_lock.c
Modified:
  head/sys/conf/files
  head/sys/fs/nfs/nfs_commonport.c
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/kern/kern_exit.c
  head/sys/kern/kern_thread.c
  head/sys/modules/Makefile
  head/sys/nlm/nlm_prot_impl.c
  head/sys/sys/proc.h

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Thu Apr  9 08:34:27 2020	(r359744)
+++ head/sys/conf/files	Thu Apr  9 14:44:46 2020	(r359745)
@@ -3489,10 +3489,10 @@ fs/msdosfs/msdosfs_iconv.c	optional msdosfs_iconv
 fs/msdosfs/msdosfs_lookup.c	optional msdosfs
 fs/msdosfs/msdosfs_vfsops.c	optional msdosfs
 fs/msdosfs/msdosfs_vnops.c	optional msdosfs
-fs/nfs/nfs_commonkrpc.c		optional nfscl | nfsd
-fs/nfs/nfs_commonsubs.c		optional nfscl | nfsd
-fs/nfs/nfs_commonport.c		optional nfscl | nfsd
-fs/nfs/nfs_commonacl.c		optional nfscl | nfsd
+fs/nfs/nfs_commonkrpc.c		optional nfscl | nfslockd | nfsd
+fs/nfs/nfs_commonsubs.c		optional nfscl | nfslockd | nfsd
+fs/nfs/nfs_commonport.c		optional nfscl | nfslockd | nfsd
+fs/nfs/nfs_commonacl.c		optional nfscl | nfslockd | nfsd
 fs/nfsclient/nfs_clcomsubs.c	optional nfscl
 fs/nfsclient/nfs_clsubs.c	optional nfscl
 fs/nfsclient/nfs_clstate.c	optional nfscl
@@ -4434,8 +4434,7 @@ nfs/bootp_subr.c		optional bootp nfscl
 nfs/krpc_subr.c			optional bootp nfscl
 nfs/nfs_diskless.c		optional nfscl nfs_root
 nfs/nfs_fha.c			optional nfsd
-nfs/nfs_lock.c			optional nfscl | nfslockd | nfsd
-nfs/nfs_nfssvc.c		optional nfscl | nfsd
+nfs/nfs_nfssvc.c		optional nfscl | nfslockd | nfsd
 nlm/nlm_advlock.c		optional nfslockd | nfsd
 nlm/nlm_prot_clnt.c		optional nfslockd | nfsd
 nlm/nlm_prot_impl.c		optional nfslockd | nfsd

Modified: head/sys/fs/nfs/nfs_commonport.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonport.c	Thu Apr  9 08:34:27 2020	(r359744)
+++ head/sys/fs/nfs/nfs_commonport.c	Thu Apr  9 14:44:46 2020	(r359745)
@@ -74,6 +74,8 @@ struct nfsdevicehead nfsrv_devidhead;
 volatile int nfsrv_devidcnt = 0;
 void (*nfsd_call_servertimer)(void) = NULL;
 void (*ncl_call_invalcaches)(struct vnode *) = NULL;
+vop_advlock_t *nfs_advlock_p = NULL;
+vop_reclaim_t *nfs_reclaim_p = NULL;
 
 int nfs_pnfsio(task_fn_t *, void *);
 

Modified: head/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clport.c	Thu Apr  9 08:34:27 2020	(r359744)
+++ head/sys/fs/nfsclient/nfs_clport.c	Thu Apr  9 14:44:46 2020	(r359745)
@@ -1412,5 +1412,4 @@ 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_clvfsops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvfsops.c	Thu Apr  9 08:34:27 2020	(r359744)
+++ head/sys/fs/nfsclient/nfs_clvfsops.c	Thu Apr  9 14:44:46 2020	(r359745)
@@ -152,7 +152,6 @@ MODULE_VERSION(nfs, 1);
 MODULE_DEPEND(nfs, nfscommon, 1, 1, 1);
 MODULE_DEPEND(nfs, krpc, 1, 1, 1);
 MODULE_DEPEND(nfs, nfssvc, 1, 1, 1);
-MODULE_DEPEND(nfs, nfslock, 1, 1, 1);
 
 /*
  * This structure is now defined in sys/nfs/nfs_diskless.c so that it

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdport.c	Thu Apr  9 08:34:27 2020	(r359744)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c	Thu Apr  9 14:44:46 2020	(r359745)
@@ -6443,7 +6443,6 @@ DECLARE_MODULE(nfsd, nfsd_mod, SI_SUB_VFS, SI_ORDER_AN
 /* So that loader and kldload(2) can find us, wherever we are.. */
 MODULE_VERSION(nfsd, 1);
 MODULE_DEPEND(nfsd, nfscommon, 1, 1, 1);
-MODULE_DEPEND(nfsd, nfslock, 1, 1, 1);
 MODULE_DEPEND(nfsd, nfslockd, 1, 1, 1);
 MODULE_DEPEND(nfsd, krpc, 1, 1, 1);
 MODULE_DEPEND(nfsd, nfssvc, 1, 1, 1);

Modified: head/sys/kern/kern_exit.c
==============================================================================
--- head/sys/kern/kern_exit.c	Thu Apr  9 08:34:27 2020	(r359744)
+++ head/sys/kern/kern_exit.c	Thu Apr  9 14:44:46 2020	(r359745)
@@ -96,9 +96,6 @@ dtrace_execexit_func_t	dtrace_fasttrap_exit;
 SDT_PROVIDER_DECLARE(proc);
 SDT_PROBE_DEFINE1(proc, , , exit, "int");
 
-/* Hook for NFS teardown procedure. */
-void (*nlminfo_release_p)(struct proc *p);
-
 struct proc *
 proc_realparent(struct proc *child)
 {
@@ -364,12 +361,6 @@ exit1(struct thread *td, int rval, int signo)
 	 * F_SETOWN with our pid.
 	 */
 	funsetownlst(&p->p_sigiolst);
-
-	/*
-	 * If this process has an nlminfo data area (for lockd), release it
-	 */
-	if (nlminfo_release_p != NULL && p->p_nlminfo != NULL)
-		(*nlminfo_release_p)(p);
 
 	/*
 	 * Close open files and release open-file table.

Modified: head/sys/kern/kern_thread.c
==============================================================================
--- head/sys/kern/kern_thread.c	Thu Apr  9 08:34:27 2020	(r359744)
+++ head/sys/kern/kern_thread.c	Thu Apr  9 14:44:46 2020	(r359745)
@@ -90,11 +90,11 @@ _Static_assert(offsetof(struct proc, p_flag) == 0xb0,
     "struct proc KBI p_flag");
 _Static_assert(offsetof(struct proc, p_pid) == 0xbc,
     "struct proc KBI p_pid");
-_Static_assert(offsetof(struct proc, p_filemon) == 0x3c0,
+_Static_assert(offsetof(struct proc, p_filemon) == 0x3b8,
     "struct proc KBI p_filemon");
-_Static_assert(offsetof(struct proc, p_comm) == 0x3d8,
+_Static_assert(offsetof(struct proc, p_comm) == 0x3d0,
     "struct proc KBI p_comm");
-_Static_assert(offsetof(struct proc, p_emuldata) == 0x4b8,
+_Static_assert(offsetof(struct proc, p_emuldata) == 0x4b0,
     "struct proc KBI p_emuldata");
 #endif
 #ifdef __i386__
@@ -110,11 +110,11 @@ _Static_assert(offsetof(struct proc, p_flag) == 0x68,
     "struct proc KBI p_flag");
 _Static_assert(offsetof(struct proc, p_pid) == 0x74,
     "struct proc KBI p_pid");
-_Static_assert(offsetof(struct proc, p_filemon) == 0x26c,
+_Static_assert(offsetof(struct proc, p_filemon) == 0x268,
     "struct proc KBI p_filemon");
-_Static_assert(offsetof(struct proc, p_comm) == 0x280,
+_Static_assert(offsetof(struct proc, p_comm) == 0x27c,
     "struct proc KBI p_comm");
-_Static_assert(offsetof(struct proc, p_emuldata) == 0x30c,
+_Static_assert(offsetof(struct proc, p_emuldata) == 0x308,
     "struct proc KBI p_emuldata");
 #endif
 

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Thu Apr  9 08:34:27 2020	(r359744)
+++ head/sys/modules/Makefile	Thu Apr  9 14:44:46 2020	(r359745)
@@ -259,7 +259,6 @@ SUBDIR=	\
 	nfscl \
 	nfscommon \
 	nfsd \
-	nfslock \
 	nfslockd \
 	nfssvc \
 	nge \

Modified: head/sys/nlm/nlm_prot_impl.c
==============================================================================
--- head/sys/nlm/nlm_prot_impl.c	Thu Apr  9 08:34:27 2020	(r359744)
+++ head/sys/nlm/nlm_prot_impl.c	Thu Apr  9 14:44:46 2020	(r359745)
@@ -2411,5 +2411,5 @@ DECLARE_MODULE(nfslockd, nfslockd_mod, SI_SUB_VFS, SI_
 
 /* So that loader and kldload(2) can find us, wherever we are.. */
 MODULE_DEPEND(nfslockd, krpc, 1, 1, 1);
-MODULE_DEPEND(nfslockd, nfslock, 1, 1, 1);
+MODULE_DEPEND(nfslockd, nfscommon, 1, 1, 1);
 MODULE_VERSION(nfslockd, 1);

Modified: head/sys/sys/proc.h
==============================================================================
--- head/sys/sys/proc.h	Thu Apr  9 08:34:27 2020	(r359744)
+++ head/sys/sys/proc.h	Thu Apr  9 14:44:46 2020	(r359745)
@@ -182,7 +182,6 @@ struct kcov_info;
 struct kdtrace_proc;
 struct kdtrace_thread;
 struct mqueue_notifier;
-struct nlminfo;
 struct p_sched;
 struct proc;
 struct procdesc;
@@ -645,7 +644,6 @@ struct proc {
 	int		p_sigparent;	/* (c) Signal to parent on exit. */
 	int		p_sig;		/* (n) For core dump/debugger XXX. */
 	u_int		p_ptevents;	/* (c + e) ptrace() event mask. */
-	struct nlminfo	*p_nlminfo;	/* (?) Only used by/for lockd. */
 	struct kaioinfo	*p_aioinfo;	/* (y) ASYNC I/O info. */
 	struct thread	*p_singlethread;/* (c + j) If single threading this is it */
 	int		p_suspcount;	/* (j) Num threads in suspended mode. */


More information about the svn-src-head mailing list