diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-11-01 03:29:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-11-01 03:29:45 -0400 |
commit | f1a6c4da14c365d3ee0b5de43a93f7470982637c (patch) | |
tree | 929b046ef28e1600cf08667459bd8c9a86069dc9 | |
parent | 261ab365fadd53ddc1b292b1663800e11fbf3e71 (diff) |
[NET]: Move the sock_copy() from the header
The sock_copy() call is not used outside the sock.c file,
so just move it into a sock.c
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/sock.h | 14 | ||||
-rw-r--r-- | net/core/sock.c | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 43fc3fa50d62..ecad7b4e2a63 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -993,20 +993,6 @@ static inline void sock_graft(struct sock *sk, struct socket *parent) | |||
993 | write_unlock_bh(&sk->sk_callback_lock); | 993 | write_unlock_bh(&sk->sk_callback_lock); |
994 | } | 994 | } |
995 | 995 | ||
996 | static inline void sock_copy(struct sock *nsk, const struct sock *osk) | ||
997 | { | ||
998 | #ifdef CONFIG_SECURITY_NETWORK | ||
999 | void *sptr = nsk->sk_security; | ||
1000 | #endif | ||
1001 | |||
1002 | memcpy(nsk, osk, osk->sk_prot->obj_size); | ||
1003 | get_net(nsk->sk_net); | ||
1004 | #ifdef CONFIG_SECURITY_NETWORK | ||
1005 | nsk->sk_security = sptr; | ||
1006 | security_sk_clone(osk, nsk); | ||
1007 | #endif | ||
1008 | } | ||
1009 | |||
1010 | extern int sock_i_uid(struct sock *sk); | 996 | extern int sock_i_uid(struct sock *sk); |
1011 | extern unsigned long sock_i_ino(struct sock *sk); | 997 | extern unsigned long sock_i_ino(struct sock *sk); |
1012 | 998 | ||
diff --git a/net/core/sock.c b/net/core/sock.c index bba9949681ff..fdacf9c8f1cb 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -857,6 +857,20 @@ static inline void sock_lock_init(struct sock *sk) | |||
857 | af_family_keys + sk->sk_family); | 857 | af_family_keys + sk->sk_family); |
858 | } | 858 | } |
859 | 859 | ||
860 | static void sock_copy(struct sock *nsk, const struct sock *osk) | ||
861 | { | ||
862 | #ifdef CONFIG_SECURITY_NETWORK | ||
863 | void *sptr = nsk->sk_security; | ||
864 | #endif | ||
865 | |||
866 | memcpy(nsk, osk, osk->sk_prot->obj_size); | ||
867 | get_net(nsk->sk_net); | ||
868 | #ifdef CONFIG_SECURITY_NETWORK | ||
869 | nsk->sk_security = sptr; | ||
870 | security_sk_clone(osk, nsk); | ||
871 | #endif | ||
872 | } | ||
873 | |||
860 | /** | 874 | /** |
861 | * sk_alloc - All socket objects are allocated here | 875 | * sk_alloc - All socket objects are allocated here |
862 | * @net: the applicable net namespace | 876 | * @net: the applicable net namespace |