diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/linux/inetdevice.h | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'include/linux/inetdevice.h')
-rw-r--r-- | include/linux/inetdevice.h | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 2be1a1a2beb9..5f8146695b7f 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/rcupdate.h> | 9 | #include <linux/rcupdate.h> |
10 | #include <linux/timer.h> | 10 | #include <linux/timer.h> |
11 | #include <linux/sysctl.h> | 11 | #include <linux/sysctl.h> |
12 | #include <linux/rtnetlink.h> | ||
12 | 13 | ||
13 | enum | 14 | enum |
14 | { | 15 | { |
@@ -40,10 +41,12 @@ enum | |||
40 | __IPV4_DEVCONF_MAX | 41 | __IPV4_DEVCONF_MAX |
41 | }; | 42 | }; |
42 | 43 | ||
44 | #define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1) | ||
45 | |||
43 | struct ipv4_devconf { | 46 | struct ipv4_devconf { |
44 | void *sysctl; | 47 | void *sysctl; |
45 | int data[__IPV4_DEVCONF_MAX - 1]; | 48 | int data[IPV4_DEVCONF_MAX]; |
46 | DECLARE_BITMAP(state, __IPV4_DEVCONF_MAX - 1); | 49 | DECLARE_BITMAP(state, IPV4_DEVCONF_MAX); |
47 | }; | 50 | }; |
48 | 51 | ||
49 | struct in_device { | 52 | struct in_device { |
@@ -51,9 +54,8 @@ struct in_device { | |||
51 | atomic_t refcnt; | 54 | atomic_t refcnt; |
52 | int dead; | 55 | int dead; |
53 | struct in_ifaddr *ifa_list; /* IP ifaddr chain */ | 56 | struct in_ifaddr *ifa_list; /* IP ifaddr chain */ |
54 | rwlock_t mc_list_lock; | 57 | struct ip_mc_list __rcu *mc_list; /* IP multicast filter chain */ |
55 | struct ip_mc_list *mc_list; /* IP multicast filter chain */ | 58 | int mc_count; /* Number of installed mcasts */ |
56 | int mc_count; /* Number of installed mcasts */ | ||
57 | spinlock_t mc_tomb_lock; | 59 | spinlock_t mc_tomb_lock; |
58 | struct ip_mc_list *mc_tomb; | 60 | struct ip_mc_list *mc_tomb; |
59 | unsigned long mr_v1_seen; | 61 | unsigned long mr_v1_seen; |
@@ -90,7 +92,7 @@ static inline void ipv4_devconf_set(struct in_device *in_dev, int index, | |||
90 | 92 | ||
91 | static inline void ipv4_devconf_setall(struct in_device *in_dev) | 93 | static inline void ipv4_devconf_setall(struct in_device *in_dev) |
92 | { | 94 | { |
93 | bitmap_fill(in_dev->cnf.state, __IPV4_DEVCONF_MAX - 1); | 95 | bitmap_fill(in_dev->cnf.state, IPV4_DEVCONF_MAX); |
94 | } | 96 | } |
95 | 97 | ||
96 | #define IN_DEV_CONF_GET(in_dev, attr) \ | 98 | #define IN_DEV_CONF_GET(in_dev, attr) \ |
@@ -142,6 +144,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
142 | #define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY) | 144 | #define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY) |
143 | 145 | ||
144 | struct in_ifaddr { | 146 | struct in_ifaddr { |
147 | struct hlist_node hash; | ||
145 | struct in_ifaddr *ifa_next; | 148 | struct in_ifaddr *ifa_next; |
146 | struct in_device *ifa_dev; | 149 | struct in_device *ifa_dev; |
147 | struct rcu_head rcu_head; | 150 | struct rcu_head rcu_head; |
@@ -158,7 +161,12 @@ struct in_ifaddr { | |||
158 | extern int register_inetaddr_notifier(struct notifier_block *nb); | 161 | extern int register_inetaddr_notifier(struct notifier_block *nb); |
159 | extern int unregister_inetaddr_notifier(struct notifier_block *nb); | 162 | extern int unregister_inetaddr_notifier(struct notifier_block *nb); |
160 | 163 | ||
161 | extern struct net_device *ip_dev_find(struct net *net, __be32 addr); | 164 | extern struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref); |
165 | static inline struct net_device *ip_dev_find(struct net *net, __be32 addr) | ||
166 | { | ||
167 | return __ip_dev_find(net, addr, true); | ||
168 | } | ||
169 | |||
162 | extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); | 170 | extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); |
163 | extern int devinet_ioctl(struct net *net, unsigned int cmd, void __user *); | 171 | extern int devinet_ioctl(struct net *net, unsigned int cmd, void __user *); |
164 | extern void devinet_init(void); | 172 | extern void devinet_init(void); |
@@ -198,14 +206,10 @@ static __inline__ int bad_mask(__be32 mask, __be32 addr) | |||
198 | 206 | ||
199 | static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev) | 207 | static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev) |
200 | { | 208 | { |
201 | struct in_device *in_dev = dev->ip_ptr; | 209 | return rcu_dereference(dev->ip_ptr); |
202 | if (in_dev) | ||
203 | in_dev = rcu_dereference(in_dev); | ||
204 | return in_dev; | ||
205 | } | 210 | } |
206 | 211 | ||
207 | static __inline__ struct in_device * | 212 | static inline struct in_device *in_dev_get(const struct net_device *dev) |
208 | in_dev_get(const struct net_device *dev) | ||
209 | { | 213 | { |
210 | struct in_device *in_dev; | 214 | struct in_device *in_dev; |
211 | 215 | ||
@@ -217,10 +221,9 @@ in_dev_get(const struct net_device *dev) | |||
217 | return in_dev; | 221 | return in_dev; |
218 | } | 222 | } |
219 | 223 | ||
220 | static __inline__ struct in_device * | 224 | static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev) |
221 | __in_dev_get_rtnl(const struct net_device *dev) | ||
222 | { | 225 | { |
223 | return (struct in_device*)dev->ip_ptr; | 226 | return rtnl_dereference(dev->ip_ptr); |
224 | } | 227 | } |
225 | 228 | ||
226 | extern void in_dev_finish_destroy(struct in_device *idev); | 229 | extern void in_dev_finish_destroy(struct in_device *idev); |