Subject: [PATCH] nethost dst: Modify dst_alloc to pass a host through on failure. From: Eric W. Biederman Date: 1137525497 -0700 If there are per host data structures all with the same set of operations we need some way to find the appropriate host to garbage collect on failure. So be simple and just pass the information through. --- include/net/dst.h | 4 ++-- net/core/dst.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) da56c8837c9769ee9124f7cf953f55044cdf5aa8 diff --git a/include/net/dst.h b/include/net/dst.h index 4a056a6..eac82eb 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -86,7 +86,7 @@ struct dst_ops unsigned short protocol; unsigned gc_thresh; - int (*gc)(void); + int (*gc)(struct nethost *host); struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); void (*destroy)(struct dst_entry *); void (*ifdown)(struct dst_entry *, @@ -169,7 +169,7 @@ static inline struct dst_entry *dst_pop( return child; } -extern void * dst_alloc(struct dst_ops * ops); +extern void * dst_alloc(struct dst_ops * ops, struct nethost *host); extern void __dst_free(struct dst_entry * dst); extern struct dst_entry *dst_destroy(struct dst_entry * dst); diff --git a/net/core/dst.c b/net/core/dst.c index eccfd3f..2f5a438 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -119,12 +119,12 @@ static int dst_discard_out(struct sk_buf return 0; } -void * dst_alloc(struct dst_ops * ops) +void * dst_alloc(struct dst_ops *ops, struct nethost *host) { struct dst_entry * dst; if (ops->gc && atomic_read(&ops->entries) > ops->gc_thresh) { - if (ops->gc()) + if (ops->gc(host)) return NULL; } dst = kmem_cache_alloc(ops->kmem_cachep, SLAB_ATOMIC); -- 1.0.GIT