summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs3proc.c
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2014-06-10 18:08:19 +0800
committerJ. Bruce Fields <bfields@redhat.com>2014-06-23 11:31:36 -0400
commit3c7aa15d2073d81e56e8ba8771a4ab6f23be7ae2 (patch)
treef76a11c503dd24636dbd36dfb9a58aa3d76ad54e /fs/nfsd/nfs3proc.c
parenta497c3ba1d97fc69c1e78e7b96435ba8c2cb42ee (diff)
downloadlinux-3c7aa15d2073d81e56e8ba8771a4ab6f23be7ae2.tar.bz2
NFSD: Using min/max/min_t/max_t for calculate
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs3proc.c')
-rw-r--r--fs/nfsd/nfs3proc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
index 401289913130..61ef42c7b0a6 100644
--- a/fs/nfsd/nfs3proc.c
+++ b/fs/nfsd/nfs3proc.c
@@ -157,11 +157,7 @@ nfsd3_proc_read(struct svc_rqst *rqstp, struct nfsd3_readargs *argp,
* 1 (status) + 22 (post_op_attr) + 1 (count) + 1 (eof)
* + 1 (xdr opaque byte count) = 26
*/
-
- resp->count = argp->count;
- if (max_blocksize < resp->count)
- resp->count = max_blocksize;
-
+ resp->count = min(argp->count, max_blocksize);
svc_reserve_auth(rqstp, ((1 + NFS3_POST_OP_ATTR_WORDS + 3)<<2) + resp->count +4);
fh_copy(&resp->fh, &argp->fh);