diff options
-rw-r--r-- | include/net/dst.h | 10 | ||||
-rw-r--r-- | net/core/dst.c | 10 |
2 files changed, 11 insertions, 9 deletions
diff --git a/include/net/dst.h b/include/net/dst.h index ae13370e8484..002500e631f5 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -163,15 +163,7 @@ struct dst_entry * dst_clone(struct dst_entry * dst) | |||
163 | return dst; | 163 | return dst; |
164 | } | 164 | } |
165 | 165 | ||
166 | static inline | 166 | extern void dst_release(struct dst_entry *dst); |
167 | void dst_release(struct dst_entry * dst) | ||
168 | { | ||
169 | if (dst) { | ||
170 | WARN_ON(atomic_read(&dst->__refcnt) < 1); | ||
171 | smp_mb__before_atomic_dec(); | ||
172 | atomic_dec(&dst->__refcnt); | ||
173 | } | ||
174 | } | ||
175 | 167 | ||
176 | /* Children define the path of the packet through the | 168 | /* Children define the path of the packet through the |
177 | * Linux networking. Thus, destinations are stackable. | 169 | * Linux networking. Thus, destinations are stackable. |
diff --git a/net/core/dst.c b/net/core/dst.c index 694cd2a3f6d2..fe03266130b6 100644 --- a/net/core/dst.c +++ b/net/core/dst.c | |||
@@ -259,6 +259,16 @@ again: | |||
259 | return NULL; | 259 | return NULL; |
260 | } | 260 | } |
261 | 261 | ||
262 | void dst_release(struct dst_entry *dst) | ||
263 | { | ||
264 | if (dst) { | ||
265 | WARN_ON(atomic_read(&dst->__refcnt) < 1); | ||
266 | smp_mb__before_atomic_dec(); | ||
267 | atomic_dec(&dst->__refcnt); | ||
268 | } | ||
269 | } | ||
270 | EXPORT_SYMBOL(dst_release); | ||
271 | |||
262 | /* Dirty hack. We did it in 2.2 (in __dst_free), | 272 | /* Dirty hack. We did it in 2.2 (in __dst_free), |
263 | * we have _very_ good reasons not to repeat | 273 | * we have _very_ good reasons not to repeat |
264 | * this mistake in 2.3, but we have no choice | 274 | * this mistake in 2.3, but we have no choice |