diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-11-01 03:37:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-11-01 03:37:32 -0400 |
commit | 8fd1d178a3f177777707ee782f12d93e9a7eb5e5 (patch) | |
tree | b1466bbdbc3b700b361cdf3a8b56650281984b79 /net/core/sock.c | |
parent | 2e4afe7b35458beedba418a6e2aaf0b0ac82cc18 (diff) |
[NET]: Make the sk_clone() lighter
The sk_prot_alloc() already performs all the stuff needed by the
sk_clone(). Besides, the sk_prot_alloc() requires almost twice
less arguments than the sk_alloc() does, so call the sk_prot_alloc()
saving the stack a bit.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 2b744c2bf466..4f4708a6ff8f 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -976,8 +976,9 @@ void sk_free(struct sock *sk) | |||
976 | 976 | ||
977 | struct sock *sk_clone(const struct sock *sk, const gfp_t priority) | 977 | struct sock *sk_clone(const struct sock *sk, const gfp_t priority) |
978 | { | 978 | { |
979 | struct sock *newsk = sk_alloc(sk->sk_net, sk->sk_family, priority, sk->sk_prot, 0); | 979 | struct sock *newsk; |
980 | 980 | ||
981 | newsk = sk_prot_alloc(sk->sk_prot, priority, sk->sk_family); | ||
981 | if (newsk != NULL) { | 982 | if (newsk != NULL) { |
982 | struct sk_filter *filter; | 983 | struct sk_filter *filter; |
983 | 984 | ||