diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2011-04-21 19:56:06 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2011-04-21 19:56:06 +0000 |
commit | 02541adb4e5e5dafe8431b8c444d4528618d8a2c (patch) | |
tree | 705b57ab83cd8c886afaf460b6a3ba85f1c0ee0a /sys/fs/nfsclient | |
parent | a6d81a941f383aa5190c00878ce4ae7ebd3cac2f (diff) | |
download | FreeBSD-src-02541adb4e5e5dafe8431b8c444d4528618d8a2c.zip FreeBSD-src-02541adb4e5e5dafe8431b8c444d4528618d8a2c.tar.gz |
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
Diffstat (limited to 'sys/fs/nfsclient')
-rw-r--r-- | sys/fs/nfsclient/nfs_clbio.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index c0633aa..fee8b05 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -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); |