X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fcore%2Fdst.c;h=fe03266130b62f4950bac5ef4786755e88617a54;hb=358c323c17ac527b82c6333db6a485112c21ab0d;hp=694cd2a3f6d2411fadae740293f1545e452e35c4;hpb=14eabf70c82cade5dbc71d2e913d533193a91785;p=linux-2.6 diff --git a/net/core/dst.c b/net/core/dst.c index 694cd2a3f6..fe03266130 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -259,6 +259,16 @@ again: return NULL; } +void dst_release(struct dst_entry *dst) +{ + if (dst) { + WARN_ON(atomic_read(&dst->__refcnt) < 1); + smp_mb__before_atomic_dec(); + atomic_dec(&dst->__refcnt); + } +} +EXPORT_SYMBOL(dst_release); + /* Dirty hack. We did it in 2.2 (in __dst_free), * we have _very_ good reasons not to repeat * this mistake in 2.3, but we have no choice