netns xfrm: dst garbage-collecting in netns
authorAlexey Dobriyan <adobriyan@gmail.com>
Wed, 26 Nov 2008 01:37:23 +0000 (17:37 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Nov 2008 01:37:23 +0000 (17:37 -0800)
Pass netns pointer to struct xfrm_policy_afinfo::garbage_collect()

[This needs more thoughts on what to do with dst_ops]
[Currently stub to init_net]

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/xfrm.h
net/ipv4/xfrm4_policy.c
net/ipv6/xfrm6_policy.c
net/xfrm/xfrm_policy.c

index 36c8cffdf4e22162f2fbe39495764525dc7ce476..bd2515005ae20d662de1a568f359cec635afe8b9 100644 (file)
@@ -265,7 +265,7 @@ struct xfrm_dst;
 struct xfrm_policy_afinfo {
        unsigned short          family;
        struct dst_ops          *dst_ops;
-       void                    (*garbage_collect)(void);
+       void                    (*garbage_collect)(struct net *net);
        struct dst_entry        *(*dst_lookup)(int tos, xfrm_address_t *saddr,
                                               xfrm_address_t *daddr);
        int                     (*get_saddr)(xfrm_address_t *saddr, xfrm_address_t *daddr);
index 84dbb5a03cc21ce864a67d01e677cac2d8c67c0f..a881ca38dddbb6846c953cd22f7bef4feecbd1ba 100644 (file)
@@ -187,7 +187,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
 
 static inline int xfrm4_garbage_collect(struct dst_ops *ops)
 {
-       xfrm4_policy_afinfo.garbage_collect();
+       xfrm4_policy_afinfo.garbage_collect(&init_net);
        return (atomic_read(&xfrm4_dst_ops.entries) > xfrm4_dst_ops.gc_thresh*2);
 }
 
index 3b67ce7786ecba68e0c46168aa1510e78abe56ae..2df8a78fc3df627e311cb5c602b21eb3ce629b7f 100644 (file)
@@ -220,7 +220,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
 
 static inline int xfrm6_garbage_collect(struct dst_ops *ops)
 {
-       xfrm6_policy_afinfo.garbage_collect();
+       xfrm6_policy_afinfo.garbage_collect(&init_net);
        return (atomic_read(&xfrm6_dst_ops.entries) > xfrm6_dst_ops.gc_thresh*2);
 }
 
index 49e089826f455de58c9e89d624af5ededd316325..7ebbdd63fca00268b48024f83a18fad805433508 100644 (file)
@@ -2173,9 +2173,9 @@ static int unused_bundle(struct dst_entry *dst)
        return !atomic_read(&dst->__refcnt);
 }
 
-static void __xfrm_garbage_collect(void)
+static void __xfrm_garbage_collect(struct net *net)
 {
-       xfrm_prune_bundles(&init_net, unused_bundle);
+       xfrm_prune_bundles(net, unused_bundle);
 }
 
 static int xfrm_flush_bundles(struct net *net)