Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 May 2011 14:19:37 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r221498 - stable/8/sys/fs/nfsclient
Message-ID:  <201105051419.p45EJbFR003180@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 



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