diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2014-10-22 21:57:35 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2014-10-22 21:57:35 +0000 |
commit | d26983570dd82c361ef12b8744b1c412d67dcf71 (patch) | |
tree | fb9c0d1405768b7c1586681ca9834e2fccc551ea /sys/fs/nfsclient | |
parent | ac030d8a9b3b1ad0509983f48fc30eba25c8d08d (diff) | |
download | FreeBSD-src-d26983570dd82c361ef12b8744b1c412d67dcf71.zip FreeBSD-src-d26983570dd82c361ef12b8744b1c412d67dcf71.tar.gz |
Revert r273481 so it can be recoded using fls(), which
some feel will make it more readable.
Diffstat (limited to 'sys/fs/nfsclient')
-rw-r--r-- | sys/fs/nfsclient/nfs_clvfsops.c | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 5e89f0c..49047f6 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -552,7 +552,7 @@ static void nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp, const char *hostname, struct ucred *cred, struct thread *td) { - int i, s; + int s; int adjsock; char *p; @@ -621,36 +621,18 @@ nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp, if ((argp->flags & NFSMNT_WSIZE) && argp->wsize > 0) { nmp->nm_wsize = argp->wsize; - /* - * Clip at the power of 2 below the size. There is an - * issue (not isolated) that causes intermittent page - * faults if this is not done. - */ - i = NFS_FABLKSIZE; - for (;;) { - if (i * 2 > nmp->nm_wsize) { - nmp->nm_wsize = i; - break; - } - i *= 2; - } + /* Round down to multiple of blocksize */ + nmp->nm_wsize &= ~(NFS_FABLKSIZE - 1); + if (nmp->nm_wsize <= 0) + nmp->nm_wsize = NFS_FABLKSIZE; } if ((argp->flags & NFSMNT_RSIZE) && argp->rsize > 0) { nmp->nm_rsize = argp->rsize; - /* - * Clip at the power of 2 below the size. There is an - * issue (not isolated) that causes intermittent page - * faults if this is not done. - */ - i = NFS_FABLKSIZE; - for (;;) { - if (i * 2 > nmp->nm_rsize) { - nmp->nm_rsize = i; - break; - } - i *= 2; - } + /* Round down to multiple of blocksize */ + nmp->nm_rsize &= ~(NFS_FABLKSIZE - 1); + if (nmp->nm_rsize <= 0) + nmp->nm_rsize = NFS_FABLKSIZE; } if ((argp->flags & NFSMNT_READDIRSIZE) && argp->readdirsize > 0) { |