diff options
author | KalimochoAz <calimochoazucarado@gmail.com> | 2012-02-20 20:13:40 +0100 |
---|---|---|
committer | KalimochoAz <calimochoazucarado@gmail.com> | 2012-02-20 20:13:40 +0100 |
commit | 4f0cd56d89c94c36a26c9d8d5df77eac16f6cc2c (patch) | |
tree | 3ce5f129ce9df0b6044f28f7bcbd366924573f3b /include/net | |
parent | 529907d16ca406a9a8ce1f9dae270fe5c198439a (diff) | |
parent | 1d05f993784973189395051cc711fdd6dd5eb389 (diff) | |
download | kernel_samsung_crespo-4f0cd56d89c94c36a26c9d8d5df77eac16f6cc2c.zip kernel_samsung_crespo-4f0cd56d89c94c36a26c9d8d5df77eac16f6cc2c.tar.gz kernel_samsung_crespo-4f0cd56d89c94c36a26c9d8d5df77eac16f6cc2c.tar.bz2 |
Merge branch 'linux-3.0.y' into cm.ics.new
Conflicts:
mm/compaction.c
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/arp.h | 1 | ||||
-rw-r--r-- | include/net/dst.h | 27 |
2 files changed, 25 insertions, 3 deletions
diff --git a/include/net/arp.h b/include/net/arp.h index 91f0568..fb0eb90 100644 --- a/include/net/arp.h +++ b/include/net/arp.h @@ -16,6 +16,7 @@ extern void arp_send(int type, int ptype, __be32 dest_ip, const unsigned char *dest_hw, const unsigned char *src_hw, const unsigned char *th); extern int arp_bind_neighbour(struct dst_entry *dst); +extern struct neighbour *__arp_bind_neighbour(struct dst_entry *dst, __be32 nexthop); extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir); extern void arp_ifdown(struct net_device *dev); diff --git a/include/net/dst.h b/include/net/dst.h index e12ddfb..d020134 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -37,7 +37,7 @@ struct dst_entry { unsigned long _metrics; unsigned long expires; struct dst_entry *path; - struct neighbour *neighbour; + struct neighbour __rcu *_neighbour; struct hh_cache *hh; #ifdef CONFIG_XFRM struct xfrm_state *xfrm; @@ -86,6 +86,21 @@ struct dst_entry { }; }; +static inline struct neighbour *dst_get_neighbour(struct dst_entry *dst) +{ + return rcu_dereference(dst->_neighbour); +} + +static inline struct neighbour *dst_get_neighbour_raw(struct dst_entry *dst) +{ + return rcu_dereference_raw(dst->_neighbour); +} + +static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh) +{ + rcu_assign_pointer(dst->_neighbour, neigh); +} + extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); extern const u32 dst_default_metrics[RTAX_MAX]; @@ -371,8 +386,14 @@ static inline void dst_rcu_free(struct rcu_head *head) static inline void dst_confirm(struct dst_entry *dst) { - if (dst) - neigh_confirm(dst->neighbour); + if (dst) { + struct neighbour *n; + + rcu_read_lock(); + n = dst_get_neighbour(dst); + neigh_confirm(n); + rcu_read_unlock(); + } } static inline void dst_link_failure(struct sk_buff *skb) |