net_namespace.h (5be5758c114b18260c6fd4c8373bf89e39b0fe82) | net_namespace.h (a685e08987d1edf1995b76511d4c98ea0e905377) |
---|---|
1/* 2 * Operations on the network namespace 3 */ 4#ifndef __NET_NET_NAMESPACE_H 5#define __NET_NET_NAMESPACE_H 6 7#include <asm/atomic.h> 8#include <linux/workqueue.h> --- 21 unchanged lines hidden (view full) --- 30struct sock; 31struct netns_ipvs; 32 33 34#define NETDEV_HASHBITS 8 35#define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS) 36 37struct net { | 1/* 2 * Operations on the network namespace 3 */ 4#ifndef __NET_NET_NAMESPACE_H 5#define __NET_NET_NAMESPACE_H 6 7#include <asm/atomic.h> 8#include <linux/workqueue.h> --- 21 unchanged lines hidden (view full) --- 30struct sock; 31struct netns_ipvs; 32 33 34#define NETDEV_HASHBITS 8 35#define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS) 36 37struct net { |
38 atomic_t passive; /* To decided when the network 39 * namespace should be freed. 40 */ |
|
38 atomic_t count; /* To decided when the network | 41 atomic_t count; /* To decided when the network |
39 * namespace should be freed. | 42 * namespace should be shut down. |
40 */ 41#ifdef NETNS_REFCNT_DEBUG 42 atomic_t use_count; /* To track references we 43 * destroy on demand 44 */ 45#endif 46 spinlock_t rules_mod_lock; 47 --- 101 unchanged lines hidden (view full) --- 149 __put_net(net); 150} 151 152static inline 153int net_eq(const struct net *net1, const struct net *net2) 154{ 155 return net1 == net2; 156} | 43 */ 44#ifdef NETNS_REFCNT_DEBUG 45 atomic_t use_count; /* To track references we 46 * destroy on demand 47 */ 48#endif 49 spinlock_t rules_mod_lock; 50 --- 101 unchanged lines hidden (view full) --- 152 __put_net(net); 153} 154 155static inline 156int net_eq(const struct net *net1, const struct net *net2) 157{ 158 return net1 == net2; 159} |
160 161extern void net_drop_ns(void *); 162 |
|
157#else 158 159static inline struct net *get_net(struct net *net) 160{ 161 return net; 162} 163 164static inline void put_net(struct net *net) --- 5 unchanged lines hidden (view full) --- 170 return net; 171} 172 173static inline 174int net_eq(const struct net *net1, const struct net *net2) 175{ 176 return 1; 177} | 163#else 164 165static inline struct net *get_net(struct net *net) 166{ 167 return net; 168} 169 170static inline void put_net(struct net *net) --- 5 unchanged lines hidden (view full) --- 176 return net; 177} 178 179static inline 180int net_eq(const struct net *net1, const struct net *net2) 181{ 182 return 1; 183} |
184 185#define net_drop_ns NULL |
|
178#endif 179 180 181#ifdef NETNS_REFCNT_DEBUG 182static inline struct net *hold_net(struct net *net) 183{ 184 if (net) 185 atomic_inc(&net->use_count); --- 98 unchanged lines hidden --- | 186#endif 187 188 189#ifdef NETNS_REFCNT_DEBUG 190static inline struct net *hold_net(struct net *net) 191{ 192 if (net) 193 atomic_inc(&net->use_count); --- 98 unchanged lines hidden --- |