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>
This commit is contained in:
committed by
J. Bruce Fields
parent
a497c3ba1d
commit
3c7aa15d20
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user