Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
35 lines
1.1 KiB
C
35 lines
1.1 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* Copyright (c) 2006-2007 Silicon Graphics, Inc.
|
|
* All Rights Reserved.
|
|
*/
|
|
#ifndef __XFS_MRU_CACHE_H__
|
|
#define __XFS_MRU_CACHE_H__
|
|
|
|
struct xfs_mru_cache;
|
|
|
|
struct xfs_mru_cache_elem {
|
|
struct list_head list_node;
|
|
unsigned long key;
|
|
};
|
|
|
|
/* Function pointer type for callback to free a client's data pointer. */
|
|
typedef void (*xfs_mru_cache_free_func_t)(void *, struct xfs_mru_cache_elem *);
|
|
|
|
int xfs_mru_cache_init(void);
|
|
void xfs_mru_cache_uninit(void);
|
|
int xfs_mru_cache_create(struct xfs_mru_cache **mrup, void *data,
|
|
unsigned int lifetime_ms, unsigned int grp_count,
|
|
xfs_mru_cache_free_func_t free_func);
|
|
void xfs_mru_cache_destroy(struct xfs_mru_cache *mru);
|
|
int xfs_mru_cache_insert(struct xfs_mru_cache *mru, unsigned long key,
|
|
struct xfs_mru_cache_elem *elem);
|
|
struct xfs_mru_cache_elem *
|
|
xfs_mru_cache_remove(struct xfs_mru_cache *mru, unsigned long key);
|
|
void xfs_mru_cache_delete(struct xfs_mru_cache *mru, unsigned long key);
|
|
struct xfs_mru_cache_elem *
|
|
xfs_mru_cache_lookup(struct xfs_mru_cache *mru, unsigned long key);
|
|
void xfs_mru_cache_done(struct xfs_mru_cache *mru);
|
|
|
|
#endif /* __XFS_MRU_CACHE_H__ */
|