]> 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)
commitc10104a15229319319b61cda69e1dc529112a1af
tree8dfad855b030522d99080433c6aa26c5d9fc57c9
parente1639f4e4b5ffc9b113b2453b7d0549f3b17007b
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