From 03f49f345749abc08bc84b835433c94eea6e972b Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Sat, 10 Nov 2007 21:28:34 -0800 Subject: [NET]: Make helper to get dst entry and "use" it There are many places that get the dst entry, increase the __use counter and set the "lastuse" time stamp. Make a helper for this. Signed-off-by: Pavel Emelyanov Signed-off-by: David S. Miller --- include/net/dst.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/net') diff --git a/include/net/dst.h b/include/net/dst.h index e9ff4a4caef..2f65e894b82 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -143,6 +143,13 @@ static inline void dst_hold(struct dst_entry * dst) atomic_inc(&dst->__refcnt); } +static inline void dst_use(struct dst_entry *dst, unsigned long time) +{ + dst_hold(dst); + dst->__use++; + dst->lastuse = time; +} + static inline struct dst_entry * dst_clone(struct dst_entry * dst) { -- cgit v1.2.3