summaryrefslogtreecommitdiffstats
path: root/include/net/dst.h
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-11-10 21:28:34 -0800
committerDavid S. Miller <davem@davemloft.net>2007-11-10 21:28:34 -0800
commit03f49f345749abc08bc84b835433c94eea6e972b (patch)
tree8fad6fef152adaa473e2ab3a824cb04fe98b3bf1 /include/net/dst.h
parentb1667609cd9a98ce32559e06f36fca54c775a51f (diff)
downloadop-kernel-dev-03f49f345749abc08bc84b835433c94eea6e972b.zip
op-kernel-dev-03f49f345749abc08bc84b835433c94eea6e972b.tar.gz
[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 <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dst.h')
-rw-r--r--include/net/dst.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index e9ff4a4..2f65e89 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)
{
OpenPOWER on IntegriCloud