* Copyright (c) 1990 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* %sccs.include.redist.c%
* @(#)lrucache.h 5.1 (Berkeley) %G%
* LRU list entries. The head of the list is the most-recently requested
* block; the tail is the least-recently requested one.
char *l_buffer
; /* buffer we return to user */
int l_pgno
; /* logical page number */
int l_flags
; /* FREE and DIRTY bits */
struct LRU_ENT
*l_prev
; /* predecessor in LRU list */
struct LRU_ENT
*l_next
; /* successor in LRU list */
* Cache entries. We use a hash table to avoid a linear walk of the LRU
* list when we need to look up blocks by number. The hash table is
typedef struct CACHE_ENT
{
struct CACHE_ENT
*c_chain
;
* The LRU cache structure. The cache size (lru_csize) is the largest size
* the user wants us to grow to; current size (lru_cursz) is always less than
* or equal to lru_csize. Note that we will grow the cache (lru_csize) if
* it's the only way that we can satisfy a user's block request.
typedef struct LRUCACHE
{
char *lru_opaque
; /* passed to inproc, outproc */
/* this is the opaque type we return for LRU caches */
/* bits for l_flags in LRU_ENT structure */
/* lru module routines */
extern CACHE_ENT
*lruhashget();
extern CACHE_ENT
*lruhashput();
extern char *lrugetnew();