Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Nov 2011 00:35:30 +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: r227809 - head/sys/fs/nfsserver
Message-ID:  <201111220035.pAM0ZUNX066505@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Tue Nov 22 00:35:30 2011
New Revision: 227809
URL: http://svn.freebsd.org/changeset/base/227809

Log:
  This patch enables the new/default NFS server's use of shared
  vnode locking for read, readdir, readlink, getattr and access.
  It is hoped that this will improve server performance for these
  operations, since they will no longer be serialized for a given
  file/vnode.

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdport.c	Tue Nov 22 00:07:53 2011	(r227808)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c	Tue Nov 22 00:35:30 2011	(r227809)
@@ -2624,7 +2624,7 @@ nfsvno_fhtovp(struct mount *mp, fhandle_
 	if (VFS_NEEDSGIANT(mp))
 		error = ESTALE;
 	else
-		error = VFS_FHTOVP(mp, &fhp->fh_fid, LK_EXCLUSIVE, vpp);
+		error = VFS_FHTOVP(mp, &fhp->fh_fid, lktype, vpp);
 	if (error != 0)
 		/* Make sure the server replies ESTALE to the client. */
 		error = ESTALE;
@@ -2645,14 +2645,6 @@ nfsvno_fhtovp(struct mount *mp, fhandle_
 				exp->nes_secflavors[i] = secflavors[i];
 		}
 	}
-	if (error == 0 && lktype == LK_SHARED)
-		/*
-		 * It would be much better to pass lktype to VFS_FHTOVP(),
-		 * but this will have to do until VFS_FHTOVP() has a lock
-		 * type argument like VFS_VGET().
-		 */
-		NFSVOPLOCK(*vpp, LK_DOWNGRADE | LK_RETRY);
-
 	NFSEXITCODE(error);
 	return (error);
 }



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