[squash with: nfs41: New xs_tcp_read_data()] Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@xxxxxxxxxx> --- net/sunrpc/xprtsock.c | 28 ++++++++++++++++++---------- 1 files changed, 18 insertions(+), 10 deletions(-) diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index fe57ebd..c6f24c0 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -1207,6 +1207,23 @@ static inline int xs_tcp_read_callback(struct rpc_xprt *xprt, return 0; } + +static inline int _xs_tcp_read_data(struct rpc_xprt *xprt, + struct xdr_skb_reader *desc) +{ + struct sock_xprt *transport = + container_of(xprt, struct sock_xprt, xprt); + + return (transport->tcp_flags & TCP_RPC_REPLY) ? + xs_tcp_read_reply(xprt, desc) : + xs_tcp_read_callback(xprt, desc); +} +#else +static inline int _xs_tcp_read_data(struct rpc_xprt *xprt, + struct xdr_skb_reader *desc) +{ + return xs_tcp_read_reply(xprt, desc); +} #endif /* CONFIG_NFS_V4_1 */ /* @@ -1218,17 +1235,8 @@ static void xs_tcp_read_data(struct rpc_xprt *xprt, { struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); - int status; - -#if defined(CONFIG_NFS_V4_1) - status = (transport->tcp_flags & TCP_RPC_REPLY) ? - xs_tcp_read_reply(xprt, desc) : - xs_tcp_read_callback(xprt, desc); -#else - status = xs_tcp_read_reply(xprt, desc); -#endif /* CONFIG_NFS_V4_1 */ - if (status == 0) + if (_xs_tcp_read_data(xprt, desc) == 0) xs_tcp_check_fraghdr(transport); else { /* -- 1.5.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html