Commit 6c302e79 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net: forward_alloc_get depends on CONFIG_MPTCP

(struct proto)->sk_forward_alloc is currently only used by MPTCP.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1ace2b4d
...@@ -1206,7 +1206,9 @@ struct proto { ...@@ -1206,7 +1206,9 @@ struct proto {
unsigned int inuse_idx; unsigned int inuse_idx;
#endif #endif
#if IS_ENABLED(CONFIG_MPTCP)
int (*forward_alloc_get)(const struct sock *sk); int (*forward_alloc_get)(const struct sock *sk);
#endif
bool (*stream_memory_free)(const struct sock *sk, int wake); bool (*stream_memory_free)(const struct sock *sk, int wake);
bool (*sock_is_readable)(struct sock *sk); bool (*sock_is_readable)(struct sock *sk);
...@@ -1295,10 +1297,11 @@ INDIRECT_CALLABLE_DECLARE(bool tcp_stream_memory_free(const struct sock *sk, int ...@@ -1295,10 +1297,11 @@ INDIRECT_CALLABLE_DECLARE(bool tcp_stream_memory_free(const struct sock *sk, int
static inline int sk_forward_alloc_get(const struct sock *sk) static inline int sk_forward_alloc_get(const struct sock *sk)
{ {
if (!sk->sk_prot->forward_alloc_get) #if IS_ENABLED(CONFIG_MPTCP)
return sk->sk_forward_alloc; if (sk->sk_prot->forward_alloc_get)
return sk->sk_prot->forward_alloc_get(sk);
return sk->sk_prot->forward_alloc_get(sk); #endif
return sk->sk_forward_alloc;
} }
static inline bool __sk_stream_memory_free(const struct sock *sk, int wake) static inline bool __sk_stream_memory_free(const struct sock *sk, int wake)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment