OSDN Git Service

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)
commitc7e0b781b73c2e26e442ed71397cc2bc5945a732
tree8dfad855b030522d99080433c6aa26c5d9fc57c9
parent7c60610d476766e128cc4284bb6349732cbd6606
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