diff options
author | David S. Miller <davem@davemloft.net> | 2011-02-16 23:08:44 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-18 00:44:00 +0100 |
commit | 3c7bd1a14071b99d6535b710bc998ae5d3abbb66 (patch) | |
tree | 05f31758aa4d6b49b70a4af4a8df4a83588610c2 /net/ipv6 | |
parent | ipv4: Consolidate ipv4 dst allocation logic. (diff) | |
download | linux-3c7bd1a14071b99d6535b710bc998ae5d3abbb66.tar.xz linux-3c7bd1a14071b99d6535b710bc998ae5d3abbb66.zip |
net: Add initial_ref arg to dst_alloc().
This allows avoiding multiple writes to the initial __refcnt.
The most simplest cases of wanting an initial reference of "1"
in ipv4 and ipv6 have been converted, the rest have been left
along and kept at the existing "0".
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/route.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index ad8556e6fd41..7946b53692da 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -221,7 +221,7 @@ static struct rt6_info ip6_blk_hole_entry_template = { /* allocate dst with ip6_dst_ops */ static inline struct rt6_info *ip6_dst_alloc(struct dst_ops *ops) { - return (struct rt6_info *)dst_alloc(ops); + return (struct rt6_info *)dst_alloc(ops, 0); } static void ip6_dst_destroy(struct dst_entry *dst) @@ -873,13 +873,12 @@ int ip6_dst_blackhole(struct sock *sk, struct dst_entry **dstp, struct flowi *fl { struct rt6_info *ort = (struct rt6_info *) *dstp; struct rt6_info *rt = (struct rt6_info *) - dst_alloc(&ip6_dst_blackhole_ops); + dst_alloc(&ip6_dst_blackhole_ops, 1); struct dst_entry *new = NULL; if (rt) { new = &rt->dst; - atomic_set(&new->__refcnt, 1); new->__use = 1; new->input = dst_discard; new->output = dst_discard; |