svn commit: r227809 - head/sys/fs/nfsserver
Rick Macklem
rmacklem at FreeBSD.org
Tue Nov 22 00:35:30 UTC 2011
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);
}
More information about the svn-src-head
mailing list