[PATCH 1/8] Move the sock_copy() from the header

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Miller <davem@...>
Cc: Linux Netdev List <netdev@...>, <devel@...>
Date: Wednesday, October 31, 2007 - 9:42 am

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>

---

diff --git a/include/net/sock.h b/include/net/sock.h
index 43fc3fa..ecad7b4 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)
 	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 unsigned long sock_i_ino(struct sock *sk);
 
diff --git a/net/core/sock.c b/net/core/sock.c
index bba9949..fdacf9c 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -857,6 +857,20 @@ static inline void sock_lock_init(struct sock *sk)
 			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
  *	@net: the applicable net namespace
-- 
1.5.3.4

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/8] Cleanup/fix the sk_alloc() call, Pavel Emelyanov, (Wed Oct 31, 9:40 am)
Re: [PATCH 0/8] Cleanup/fix the sk_alloc() call, Arnaldo Carvalho de Melo, (Wed Oct 31, 9:15 am)
Re: [PATCH 0/8] Cleanup/fix the sk_alloc() call, Pavel Emelyanov, (Wed Oct 31, 10:32 am)
Re: [PATCH 0/8] Cleanup/fix the sk_alloc() call, Arnaldo Carvalho de Melo, (Wed Oct 31, 10:14 am)
[PATCH 8/8] Forget the zero_it argument of sk_alloc(), Pavel Emelyanov, (Wed Oct 31, 9:59 am)
[PATCH 7/8] Remove bogus zero_it argument from sk_alloc, Pavel Emelyanov, (Wed Oct 31, 9:56 am)
[PATCH 6/8] Make the sk_clone() lighter, Pavel Emelyanov, (Wed Oct 31, 9:54 am)
Re: [PATCH 6/8] Make the sk_clone() lighter, David Miller, (Thu Nov 1, 3:38 am)
Re: [PATCH 6/8] Make the sk_clone() lighter, David Miller, (Thu Nov 1, 3:26 am)
Re: [PATCH 6/8] Make the sk_clone() lighter, Pavel Emelyanov, (Thu Nov 1, 4:46 am)
[PATCH 5/8] Move some core sock setup into sk_prot_alloc, Pavel Emelyanov, (Wed Oct 31, 9:51 am)
[PATCH 4/8] Auto-zero the allocated sock object, Pavel Emelyanov, (Wed Oct 31, 9:48 am)
Re: [PATCH 4/8] Auto-zero the allocated sock object, David Miller, (Thu Nov 1, 3:35 am)
[PATCH 2/8] Move the get_net() from sock_copy(), Pavel Emelyanov, (Wed Oct 31, 9:44 am)
Re: [PATCH 2/8] Move the get_net() from sock_copy(), David Miller, (Thu Nov 1, 3:32 am)
[PATCH 1/8] Move the sock_copy() from the header, Pavel Emelyanov, (Wed Oct 31, 9:42 am)
Re: [PATCH 1/8] Move the sock_copy() from the header, David Miller, (Thu Nov 1, 3:30 am)