Commit 57fed777 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add a LRU_Free() function

parent abf653cd
......@@ -55,12 +55,6 @@ static const struct stevedore * volatile stv_next;
static struct stevedore *stv_transient;
/*--------------------------------------------------------------------
* NB! Dirty trick alert:
*
* We use a captive objcore as tail senteniel for LRU lists, but to
* make sure it does not get into play by accident, we do _not_
* initialize its magic with OBJCORE_MAGIC.
*
*/
struct lru *
......@@ -75,6 +69,14 @@ LRU_Alloc(void)
return (l);
}
void
LRU_Free(struct lru *lru)
{
CHECK_OBJ_NOTNULL(lru, LRU_MAGIC);
Lck_Delete(&lru->mtx);
FREE_OBJ(lru);
}
/*--------------------------------------------------------------------
* XXX: trust pointer writes to be atomic
*/
......
......@@ -102,6 +102,7 @@ void STV_Config_Transient(void);
void STV_Freestore(struct object *o);
struct lru *LRU_Alloc(void);
void LRU_Free(struct lru *lru);
int STV_GetFile(const char *fn, int *fdp, const char **fnp, const char *ctx);
uintmax_t STV_FileSize(int fd, const char *size, unsigned *granularity,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment