dst_cache.h (c13aca79ff3c4af5fd31a5b2743a90eba6e36a26) dst_cache.h (20ae1d6aa159eb91a9bf09ff92ccaa94dbea92c2)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _NET_DST_CACHE_H
3#define _NET_DST_CACHE_H
4
5#include <linux/jiffies.h>
6#include <net/dst.h>
7#if IS_ENABLED(CONFIG_IPV6)
8#include <net/ip6_fib.h>

--- 66 unchanged lines hidden (view full) ---

75 * the dst will be freed on later cache lookup.
76 */
77static inline void dst_cache_reset(struct dst_cache *dst_cache)
78{
79 dst_cache->reset_ts = jiffies;
80}
81
82/**
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _NET_DST_CACHE_H
3#define _NET_DST_CACHE_H
4
5#include <linux/jiffies.h>
6#include <net/dst.h>
7#if IS_ENABLED(CONFIG_IPV6)
8#include <net/ip6_fib.h>

--- 66 unchanged lines hidden (view full) ---

75 * the dst will be freed on later cache lookup.
76 */
77static inline void dst_cache_reset(struct dst_cache *dst_cache)
78{
79 dst_cache->reset_ts = jiffies;
80}
81
82/**
83 * dst_cache_reset_now - invalidate the cache contents immediately
84 * @dst_cache: the cache
85 *
86 * The caller must be sure there are no concurrent users, as this frees
87 * all dst_cache users immediately, rather than waiting for the next
88 * per-cpu usage like dst_cache_reset does. Most callers should use the
89 * higher speed lazily-freed dst_cache_reset function instead.
90 */
91void dst_cache_reset_now(struct dst_cache *dst_cache);
92
93/**
83 * dst_cache_init - initialize the cache, allocating the required storage
84 * @dst_cache: the cache
85 * @gfp: allocation flags
86 */
87int dst_cache_init(struct dst_cache *dst_cache, gfp_t gfp);
88
89/**
90 * dst_cache_destroy - empty the cache and free the allocated storage
91 * @dst_cache: the cache
92 *
93 * No synchronization is enforced: it must be called only when the cache
94 * is unsed.
95 */
96void dst_cache_destroy(struct dst_cache *dst_cache);
97
98#endif
94 * dst_cache_init - initialize the cache, allocating the required storage
95 * @dst_cache: the cache
96 * @gfp: allocation flags
97 */
98int dst_cache_init(struct dst_cache *dst_cache, gfp_t gfp);
99
100/**
101 * dst_cache_destroy - empty the cache and free the allocated storage
102 * @dst_cache: the cache
103 *
104 * No synchronization is enforced: it must be called only when the cache
105 * is unsed.
106 */
107void dst_cache_destroy(struct dst_cache *dst_cache);
108
109#endif