summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2004-01-31 10:40:15 +0000
committerobrien <obrien@FreeBSD.org>2004-01-31 10:40:15 +0000
commitac460e8a52313c38e9e4e8d52da016ce8df9e8e3 (patch)
tree59e923587f909be636369b714d8ca4ea32504d03
parent65604f86ee3a8ec435ce4ec869f62b9e9e940b00 (diff)
downloadFreeBSD-src-ac460e8a52313c38e9e4e8d52da016ce8df9e8e3.zip
FreeBSD-src-ac460e8a52313c38e9e4e8d52da016ce8df9e8e3.tar.gz
Bump the NFCv3/TCP defaults for rsize and wsize from 8K to 32K to match
Solaris and HP-UX. This increases read performance for large files across NFS. PR: 62024 & 26324 Submitted by: Bjoern Groenvall <bg@sics.se>
-rw-r--r--sys/nfsclient/nfs_vfsops.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index a6ddfbb..efc8772 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -359,6 +359,7 @@ nfs_fsinfo(struct nfsmount *nmp, struct vnode *vp, struct ucred *cred,
maxfsize = fxdr_hyper(&fsp->fs_maxfilesize);
if (maxfsize > 0 && maxfsize < nmp->nm_maxfilesize)
nmp->nm_maxfilesize = maxfsize;
+ nmp->nm_mountp->mnt_stat.f_iosize = nfs_iosize(nmp);
nmp->nm_state |= NFSSTA_GOTFSINFO;
}
m_freem(mrep);
@@ -785,8 +786,12 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam,
nmp->nm_timeo = NFS_TIMEO;
nmp->nm_retry = NFS_RETRANS;
- nmp->nm_wsize = NFS_WSIZE;
- nmp->nm_rsize = NFS_RSIZE;
+ if ((argp->flags & NFSMNT_NFSV3) && argp->sotype == SOCK_STREAM) {
+ nmp->nm_wsize = nmp->nm_rsize = NFS_MAXDATA;
+ } else {
+ nmp->nm_wsize = NFS_WSIZE;
+ nmp->nm_rsize = NFS_RSIZE;
+ }
nmp->nm_readdirsize = NFS_READDIRSIZE;
nmp->nm_numgrps = NFS_MAXGRPS;
nmp->nm_readahead = NFS_DEFRAHEAD;
@@ -832,10 +837,14 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam,
*vpp = NFSTOV(np);
/*
- * Get file attributes for the mountpoint. This has the side
- * effect of filling in (*vpp)->v_type with the correct value.
+ * Get file attributes and transfer parameters for the
+ * mountpoint. This has the side effect of filling in
+ * (*vpp)->v_type with the correct value.
*/
- VOP_GETATTR(*vpp, &attrs, curthread->td_ucred, curthread);
+ if (argp->flags & NFSMNT_NFSV3)
+ nfs_fsinfo(nmp, *vpp, curthread->td_ucred, curthread);
+ else
+ VOP_GETATTR(*vpp, &attrs, curthread->td_ucred, curthread);
/*
* Lose the lock but keep the ref.
@@ -905,6 +914,13 @@ nfs_root(struct mount *mp, struct vnode **vpp)
if (error)
return (error);
vp = NFSTOV(np);
+ /*
+ * Get transfer parameters and attributes for root vnode once.
+ */
+ if ((nmp->nm_state & NFSSTA_GOTFSINFO) == 0 &&
+ (nmp->nm_flag & NFSMNT_NFSV3)) {
+ nfs_fsinfo(nmp, vp, curthread->td_ucred, curthread);
+ }
if (vp->v_type == VNON)
vp->v_type = VDIR;
vp->v_vflag |= VV_ROOT;
OpenPOWER on IntegriCloud