svn commit: r221498 - stable/8/sys/fs/nfsclient

Rick Macklem rmacklem at FreeBSD.org
Thu May 5 14:19:38 UTC 2011


Author: rmacklem
Date: Thu May  5 14:19:37 2011
New Revision: 221498
URL: http://svn.freebsd.org/changeset/base/221498

Log:
  MFC: r220928
  Remove the nm_mtx mutex locking from the test for
  nm_maxfilesize. This value rarely, if ever, changes
  and the nm_mtx mutex is locked/unlocked earlier in
  the function, which should be sufficient to avoid
  getting a stale cached value for it. There is a
  discussion w.r.t. what these tests should be, but
  I've left them basically the same as the regular
  NFS client for now.

Modified:
  stable/8/sys/fs/nfsclient/nfs_clbio.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/fs/nfsclient/nfs_clbio.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clbio.c	Thu May  5 14:16:40 2011	(r221497)
+++ stable/8/sys/fs/nfsclient/nfs_clbio.c	Thu May  5 14:19:37 2011	(r221498)
@@ -943,12 +943,8 @@ flush_and_restart:
 	if (uio->uio_offset < 0)
 		return (EINVAL);
 	tmp_off = uio->uio_offset + uio->uio_resid;
-	mtx_lock(&nmp->nm_mtx);
-	if (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset) {
-		mtx_unlock(&nmp->nm_mtx);
+	if (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset)
 		return (EFBIG);
-	}
-	mtx_unlock(&nmp->nm_mtx);
 	if (uio->uio_resid == 0)
 		return (0);
 


More information about the svn-src-all mailing list