Date: Thu, 21 Apr 2011 19:56:07 +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: r220928 - head/sys/fs/nfsclient Message-ID: <201104211956.p3LJu7AB010264@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Thu Apr 21 19:56:06 2011 New Revision: 220928 URL: http://svn.freebsd.org/changeset/base/220928 Log: 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. Suggested by: pjd MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clbio.c Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Thu Apr 21 16:40:34 2011 (r220927) +++ head/sys/fs/nfsclient/nfs_clbio.c Thu Apr 21 19:56:06 2011 (r220928) @@ -946,12 +946,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?201104211956.p3LJu7AB010264>