SUNRPC: Inline xdr_commit_encode
authorChuck Lever <chuck.lever@oracle.com>
Mon, 19 Aug 2019 22:37:05 +0000 (18:37 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 20 Aug 2019 14:28:50 +0000 (10:28 -0400)
Micro-optimization: For xdr_commit_encode call sites in
net/sunrpc/xdr.c, eliminate the extra calling sequence.  On my
client, this change saves about a microsecond for every 30 calls
to xdr_reserve_space().

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/xdr.c

index 48c93b9e525ee3301718e1a5a17be0b92ace1e30..7ba0ede6b417a4eac36ba9c24a5a0fc126213b85 100644 (file)
@@ -560,7 +560,7 @@ EXPORT_SYMBOL_GPL(xdr_init_encode);
  * required at the end of encoding, or any other time when the xdr_buf
  * data might be read.
  */
-void xdr_commit_encode(struct xdr_stream *xdr)
+inline void xdr_commit_encode(struct xdr_stream *xdr)
 {
        int shift = xdr->scratch.iov_len;
        void *page;