X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fnet%2Fdst.h;h=33fd86690d18605ebd5379fe00155f7cebe29262;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=ed2504c6b4e93a018f045304b136604d17178ef4;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/include/net/dst.h b/include/net/dst.h index ed2504c6b..33fd86690 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -142,15 +142,16 @@ struct dst_entry * dst_clone(struct dst_entry * dst) return dst; } +extern const char dst_underflow_bug_msg[]; + static inline void dst_release(struct dst_entry * dst) { if (dst) { - if (atomic_read(&dst->__refcnt) < 1) { - printk("BUG: dst underflow %d: %p\n", - atomic_read(&dst->__refcnt), - current_text_addr()); - } + if (atomic_read(&dst->__refcnt) < 1) + printk(dst_underflow_bug_msg, + atomic_read(&dst->__refcnt), + dst, current_text_addr()); atomic_dec(&dst->__refcnt); } } @@ -183,6 +184,12 @@ static inline void dst_free(struct dst_entry * dst) __dst_free(dst); } +static inline void dst_rcu_free(struct rcu_head *head) +{ + struct dst_entry *dst = container_of(head, struct dst_entry, rcu_head); + dst_free(dst); +} + static inline void dst_confirm(struct dst_entry *dst) { if (dst)