svn commit: r210136 - in head/sys: fs/nfsclient nfsclient

John Baldwin jhb at FreeBSD.org
Thu Jul 15 19:40:49 UTC 2010


Author: jhb
Date: Thu Jul 15 19:40:48 2010
New Revision: 210136
URL: http://svn.freebsd.org/changeset/base/210136

Log:
  Retire the NFS access cache timestamp structure.  It was used in VOP_OPEN()
  to avoid sending multiple ACCESS/GETATTR RPCs during a single open()
  between VOP_LOOKUP() and VOP_OPEN().  Now we always send the RPC in
  VOP_LOOKUP() and not VOP_OPEN() in the cases that multiple RPCs could be
  sent.
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/fs/nfsclient/nfsnode.h
  head/sys/nfsclient/nfs_subs.c
  head/sys/nfsclient/nfsnode.h

Modified: head/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clport.c	Thu Jul 15 19:21:48 2010	(r210135)
+++ head/sys/fs/nfsclient/nfs_clport.c	Thu Jul 15 19:40:48 2010	(r210136)
@@ -340,7 +340,6 @@ nfscl_loadattrcache(struct vnode **vpp, 
 	struct nfsnode *np;
 	struct nfsmount *nmp;
 	struct timespec mtime_save;
-	struct thread *td = curthread;
 
 	/*
 	 * If v_type == VNON it is a new node, so fill in the v_type,
@@ -386,14 +385,6 @@ nfscl_loadattrcache(struct vnode **vpp, 
 	else
 		vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0];
 	np->n_attrstamp = time_second;
-	/* Timestamp the NFS otw getattr fetch */
-	if (td->td_proc) {
-		np->n_ac_ts_tid = td->td_tid;
-		np->n_ac_ts_pid = td->td_proc->p_pid;
-		np->n_ac_ts_syscalls = td->td_syscalls;
-	} else
-		bzero(&np->n_ac_ts, sizeof(struct nfs_attrcache_timestamp));
-	
 	if (vap->va_size != np->n_size) {
 		if (vap->va_type == VREG) {
 			if (dontshrink && vap->va_size < np->n_size) {

Modified: head/sys/fs/nfsclient/nfsnode.h
==============================================================================
--- head/sys/fs/nfsclient/nfsnode.h	Thu Jul 15 19:21:48 2010	(r210135)
+++ head/sys/fs/nfsclient/nfsnode.h	Thu Jul 15 19:40:48 2010	(r210136)
@@ -68,16 +68,6 @@ struct nfsdmap {
 #define	ndm_cookies	ndm_un1.ndmu3_cookies
 #define	ndm4_cookies	ndm_un1.ndmu4_cookies
 
-#define	n_ac_ts_tid		n_ac_ts.nfs_ac_ts_tid
-#define	n_ac_ts_pid		n_ac_ts.nfs_ac_ts_pid
-#define	n_ac_ts_syscalls	n_ac_ts.nfs_ac_ts_syscalls
-
-struct nfs_attrcache_timestamp {
-	lwpid_t		nfs_ac_ts_tid;
-	pid_t		nfs_ac_ts_pid;
-	unsigned long	nfs_ac_ts_syscalls;	
-};
-
 struct nfs_accesscache {
 	u_int32_t		mode;	/* ACCESS mode cache */
 	uid_t			uid;	/* credentials having mode */
@@ -132,7 +122,6 @@ struct nfsnode {
 	u_int32_t		n_flag;		/* Flag for locking.. */
 	int			n_directio_opens;
 	int                     n_directio_asyncwr;
-	struct nfs_attrcache_timestamp n_ac_ts;
 	u_int64_t		 n_change;	/* old Change attribute */
 	struct nfsv4node	*n_v4;		/* extra V4 stuff */
 };

Modified: head/sys/nfsclient/nfs_subs.c
==============================================================================
--- head/sys/nfsclient/nfs_subs.c	Thu Jul 15 19:21:48 2010	(r210135)
+++ head/sys/nfsclient/nfs_subs.c	Thu Jul 15 19:40:48 2010	(r210136)
@@ -470,7 +470,6 @@ nfs_loadattrcache(struct vnode **vpp, st
 	u_short vmode;
 	struct timespec mtime, mtime_save;
 	int v3 = NFS_ISV3(vp);
-	struct thread *td = curthread;
 	int error = 0;
 
 	md = *mdp;
@@ -574,14 +573,6 @@ nfs_loadattrcache(struct vnode **vpp, st
 		vap->va_filerev = 0;
 	}
 	np->n_attrstamp = time_second;
-	/* Timestamp the NFS otw getattr fetch */
-	if (td->td_proc) {
-		np->n_ac_ts_tid = td->td_tid;
-		np->n_ac_ts_pid = td->td_proc->p_pid;
-		np->n_ac_ts_syscalls = td->td_syscalls;
-	} else
-		bzero(&np->n_ac_ts, sizeof(struct nfs_attrcache_timestamp));
-	
 	if (vap->va_size != np->n_size) {
 		if (vap->va_type == VREG) {
 			if (dontshrink && vap->va_size < np->n_size) {

Modified: head/sys/nfsclient/nfsnode.h
==============================================================================
--- head/sys/nfsclient/nfsnode.h	Thu Jul 15 19:21:48 2010	(r210135)
+++ head/sys/nfsclient/nfsnode.h	Thu Jul 15 19:40:48 2010	(r210136)
@@ -74,16 +74,6 @@ struct nfsdmap {
 #define ndm_cookies	ndm_un1.ndmu3_cookies
 #define ndm4_cookies	ndm_un1.ndmu4_cookies
 
-#define n_ac_ts_tid		n_ac_ts.nfs_ac_ts_tid
-#define n_ac_ts_pid		n_ac_ts.nfs_ac_ts_pid
-#define n_ac_ts_syscalls	n_ac_ts.nfs_ac_ts_syscalls
-
-struct nfs_attrcache_timestamp {
-	lwpid_t		nfs_ac_ts_tid;
-	pid_t		nfs_ac_ts_pid;
-	unsigned long	nfs_ac_ts_syscalls;	
-};
-
 struct nfs_accesscache {
 	u_int32_t		mode;		/* ACCESS mode cache */
 	uid_t			uid;		/* credentials having mode */
@@ -140,7 +130,6 @@ struct nfsnode {
 	uint32_t		n_namelen;
 	int			n_directio_opens;
 	int                     n_directio_asyncwr;
-	struct nfs_attrcache_timestamp n_ac_ts;
 };
 
 #define n_atim		n_un1.nf_atim


More information about the svn-src-all mailing list