Commit f1a6c4da authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

[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: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 261ab365
...@@ -993,20 +993,6 @@ static inline void sock_graft(struct sock *sk, struct socket *parent) ...@@ -993,20 +993,6 @@ static inline void sock_graft(struct sock *sk, struct socket *parent)
write_unlock_bh(&sk->sk_callback_lock); write_unlock_bh(&sk->sk_callback_lock);
} }
static inline void sock_copy(struct sock *nsk, const struct sock *osk)
{
#ifdef CONFIG_SECURITY_NETWORK
void *sptr = nsk->sk_security;
#endif
memcpy(nsk, osk, osk->sk_prot->obj_size);
get_net(nsk->sk_net);
#ifdef CONFIG_SECURITY_NETWORK
nsk->sk_security = sptr;
security_sk_clone(osk, nsk);
#endif
}
extern int sock_i_uid(struct sock *sk); extern int sock_i_uid(struct sock *sk);
extern unsigned long sock_i_ino(struct sock *sk); extern unsigned long sock_i_ino(struct sock *sk);
......
...@@ -857,6 +857,20 @@ static inline void sock_lock_init(struct sock *sk) ...@@ -857,6 +857,20 @@ static inline void sock_lock_init(struct sock *sk)
af_family_keys + sk->sk_family); af_family_keys + sk->sk_family);
} }
static void sock_copy(struct sock *nsk, const struct sock *osk)
{
#ifdef CONFIG_SECURITY_NETWORK
void *sptr = nsk->sk_security;
#endif
memcpy(nsk, osk, osk->sk_prot->obj_size);
get_net(nsk->sk_net);
#ifdef CONFIG_SECURITY_NETWORK
nsk->sk_security = sptr;
security_sk_clone(osk, nsk);
#endif
}
/** /**
* sk_alloc - All socket objects are allocated here * sk_alloc - All socket objects are allocated here
* @net: the applicable net namespace * @net: the applicable net namespace
......
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