]> git.baikalelectronics.ru Git - kernel.git/commit
NFSD: Clean up splice actor
authorChuck Lever <chuck.lever@oracle.com>
Mon, 28 Jun 2021 20:34:20 +0000 (16:34 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 17 Aug 2021 15:47:52 +0000 (11:47 -0400)
commitb048721c623d72a1309bc0f795c9846bb6036898
tree8dfad855b030522d99080433c6aa26c5d9fc57c9
parent799b7595dbd054559c382026eb5ad31bca6fea67
NFSD: Clean up splice actor

A few useful observations:

 - The value in @size is never modified.

 - splice_desc.len is an unsigned int, and so is xdr_buf.page_len.
   An implicit cast to size_t is unnecessary.

 - The computation of .page_len is the same in all three arms
   of the "if" statement, so hoist it out to make it clear that
   the operation is an unconditional invariant.

The resulting function is 18 bytes shorter on my system (-Os).

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: NeilBrown <neilb@suse.de>
fs/nfsd/vfs.c