aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-06-01 02:51:19 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-02 08:16:23 -0400
commitc2d9ba9bce8d7323ca96f239e1f505c14d6244fb (patch)
tree7a184eefa2e48e6aa15cdf3aefb6ccf2fb834320 /include/net/sock.h
parentc6b20d941b08941bece53bc3d857beb1fb25fffc (diff)
net: CONFIG_NET_NS reduction
Use read_pnet() and write_pnet() to reduce number of ifdef CONFIG_NET_NS Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index ca241ea1487..3461e5d1e9a 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1724,19 +1724,13 @@ static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_e
1724static inline 1724static inline
1725struct net *sock_net(const struct sock *sk) 1725struct net *sock_net(const struct sock *sk)
1726{ 1726{
1727#ifdef CONFIG_NET_NS 1727 return read_pnet(&sk->sk_net);
1728 return sk->sk_net;
1729#else
1730 return &init_net;
1731#endif
1732} 1728}
1733 1729
1734static inline 1730static inline
1735void sock_net_set(struct sock *sk, struct net *net) 1731void sock_net_set(struct sock *sk, struct net *net)
1736{ 1732{
1737#ifdef CONFIG_NET_NS 1733 write_pnet(&sk->sk_net, net);
1738 sk->sk_net = net;
1739#endif
1740} 1734}
1741 1735
1742/* 1736/*