From 9e9439637226316ae908536a8e8e77a964aa14b1 Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Fri, 30 Jul 2004 08:47:05 -0700 Subject: [PATCH] [PATCH] inline fixes in net/* * in ipv6/route.c: made ipv6_advmss() inlined again (and moved it up) * in sunrpc/xprt.c: inlining fix: moved do_xprt_reserve() up Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- net/ipv6/route.c | 37 ++++++++++++++++++------------------- net/sunrpc/xprt.c | 30 +++++++++++++++--------------- 2 files changed, 33 insertions(+), 34 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index a6b6a1be88b11..143543f262a6d 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -584,7 +584,24 @@ static void ip6_rt_update_pmtu(struct dst_entry *dst, u32 mtu) /* Protected by rt6_lock. */ static struct dst_entry *ndisc_dst_gc_list; static int ipv6_get_mtu(struct net_device *dev); -static unsigned int ipv6_advmss(unsigned int mtu); + +static inline unsigned int ipv6_advmss(unsigned int mtu) +{ + mtu -= sizeof(struct ipv6hdr) + sizeof(struct tcphdr); + + if (mtu < ip6_rt_min_advmss) + mtu = ip6_rt_min_advmss; + + /* + * Maximal non-jumbo IPv6 payload is IPV6_MAXPLEN and + * corresponding MSS is IPV6_MAXPLEN - tcp_header_size. + * IPV6_MAXPLEN is also valid and means: "any MSS, + * rely only on pmtu discovery" + */ + if (mtu > IPV6_MAXPLEN - sizeof(struct tcphdr)) + mtu = IPV6_MAXPLEN; + return mtu; +} struct dst_entry *ndisc_dst_alloc(struct net_device *dev, struct neighbour *neigh, @@ -692,24 +709,6 @@ static int ipv6_get_mtu(struct net_device *dev) return mtu; } -static unsigned int ipv6_advmss(unsigned int mtu) -{ - mtu -= sizeof(struct ipv6hdr) + sizeof(struct tcphdr); - - if (mtu < ip6_rt_min_advmss) - mtu = ip6_rt_min_advmss; - - /* - * Maximal non-jumbo IPv6 payload is IPV6_MAXPLEN and - * corresponding MSS is IPV6_MAXPLEN - tcp_header_size. - * IPV6_MAXPLEN is also valid and means: "any MSS, - * rely only on pmtu discovery" - */ - if (mtu > IPV6_MAXPLEN - sizeof(struct tcphdr)) - mtu = IPV6_MAXPLEN; - return mtu; -} - static int ipv6_get_hoplimit(struct net_device *dev) { int hoplimit = ipv6_devconf.hop_limit; diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 5fbbe608b14f5..a7ab07fe5cc04 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -1296,21 +1296,6 @@ xprt_transmit(struct rpc_task *task) /* * Reserve an RPC call slot. */ -void -xprt_reserve(struct rpc_task *task) -{ - struct rpc_xprt *xprt = task->tk_xprt; - - task->tk_status = -EIO; - if (!xprt->shutdown) { - spin_lock(&xprt->xprt_lock); - do_xprt_reserve(task); - spin_unlock(&xprt->xprt_lock); - if (task->tk_rqstp) - del_timer_sync(&xprt->timer); - } -} - static inline void do_xprt_reserve(struct rpc_task *task) { @@ -1332,6 +1317,21 @@ do_xprt_reserve(struct rpc_task *task) rpc_sleep_on(&xprt->backlog, task, NULL, NULL); } +void +xprt_reserve(struct rpc_task *task) +{ + struct rpc_xprt *xprt = task->tk_xprt; + + task->tk_status = -EIO; + if (!xprt->shutdown) { + spin_lock(&xprt->xprt_lock); + do_xprt_reserve(task); + spin_unlock(&xprt->xprt_lock); + if (task->tk_rqstp) + del_timer_sync(&xprt->timer); + } +} + /* * Allocate a 'unique' XID */ -- 2.53.0