diff options
author | kib <kib@FreeBSD.org> | 2012-02-21 01:05:12 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2012-02-21 01:05:12 +0000 |
commit | 80ae8fe82cdaa69f78dc90fa27bc9e79863de0ea (patch) | |
tree | d0d078391c4959fc08545db4ab619daadd9cf1d9 /sys/nfsclient | |
parent | 31a24bc1664a822f3d06595f42063719e6902ff1 (diff) | |
download | FreeBSD-src-80ae8fe82cdaa69f78dc90fa27bc9e79863de0ea.zip FreeBSD-src-80ae8fe82cdaa69f78dc90fa27bc9e79863de0ea.tar.gz |
Fix found places where uio_resid is truncated to int.
Add the sysctl debug.iosize_max_clamp, enabled by default. Setting the
sysctl to zero allows to perform the SSIZE_MAX-sized i/o requests from
the usermode.
Discussed with: bde, das (previous versions)
MFC after: 1 month
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_bio.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c index d564c08..4a90ad7 100644 --- a/sys/nfsclient/nfs_bio.c +++ b/sys/nfsclient/nfs_bio.c @@ -564,7 +564,7 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) n = 0; if (on < bcount) - n = min((unsigned)(bcount - on), uio->uio_resid); + n = MIN((unsigned)(bcount - on), uio->uio_resid); break; case VLNK: nfsstats.biocache_readlinks++; @@ -583,7 +583,7 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) return (error); } } - n = min(uio->uio_resid, NFS_MAXPATHLEN - bp->b_resid); + n = MIN(uio->uio_resid, NFS_MAXPATHLEN - bp->b_resid); on = 0; break; case VDIR: @@ -751,8 +751,8 @@ nfs_directio_write(vp, uiop, cred, ioflag) struct iovec iov; do_sync: while (uiop->uio_resid > 0) { - size = min(uiop->uio_resid, wsize); - size = min(uiop->uio_iov->iov_len, size); + size = MIN(uiop->uio_resid, wsize); + size = MIN(uiop->uio_iov->iov_len, size); iov.iov_base = uiop->uio_iov->iov_base; iov.iov_len = size; uio.uio_iov = &iov; @@ -800,8 +800,8 @@ do_sync: * in NFS directio access. */ while (uiop->uio_resid > 0) { - size = min(uiop->uio_resid, wsize); - size = min(uiop->uio_iov->iov_len, size); + size = MIN(uiop->uio_resid, wsize); + size = MIN(uiop->uio_iov->iov_len, size); bp = getpbuf(&nfs_pbuf_freecnt); t_uio = malloc(sizeof(struct uio), M_NFSDIRECTIO, M_WAITOK); t_iov = malloc(sizeof(struct iovec), M_NFSDIRECTIO, M_WAITOK); @@ -1014,7 +1014,7 @@ flush_and_restart: nfsstats.biocache_writes++; lbn = uio->uio_offset / biosize; on = uio->uio_offset & (biosize-1); - n = min((unsigned)(biosize - on), uio->uio_resid); + n = MIN((unsigned)(biosize - on), uio->uio_resid); again: /* * Handle direct append and file extension cases, calculate |