sys: FSP_META_CACHE: initial implementation

This commit is contained in:
Bill Zissimopoulos 2016-02-17 16:57:37 -08:00
parent 0abd173898
commit 990955ff61
2 changed files with 3 additions and 14 deletions

View File

@ -400,8 +400,7 @@ NTSTATUS MetaCacheCreate(
ULONG MetaCapacity, ULONG ItemSizeMax, PLARGE_INTEGER MetaTimeout,
FSP_META_CACHE **PMetaCache);
VOID MetaCacheDelete(FSP_META_CACHE *MetaCache);
VOID MetaCacheInvalidateAll(FSP_META_CACHE *MetaCache);
VOID MetaCacheInvalidateExpired(FSP_META_CACHE *MetaCache);
VOID MetaCacheInvalidateExpired(FSP_META_CACHE *MetaCache, UINT64 ExpirationTime);
PVOID MetaCacheReferenceItemBuffer(FSP_META_CACHE *MetaCache, UINT64 ItemIndex, PULONG PSize);
VOID MetaCacheDereferenceItemBuffer(PVOID Buffer);
UINT64 MetaCacheAddItem(FSP_META_CACHE *MetaCache, PVOID Buffer, ULONG Size);

View File

@ -62,11 +62,11 @@ NTSTATUS MetaCacheCreate(
VOID MetaCacheDelete(FSP_META_CACHE *MetaCache)
{
MetaCacheInvalidateAll(MetaCache);
MetaCacheInvalidateExpired(MetaCache, (UINT64)-1LL);
FspFree(MetaCache);
}
static VOID MetaCacheInvalidateItems(FSP_META_CACHE *MetaCache, UINT64 ExpirationTime)
VOID MetaCacheInvalidateExpired(FSP_META_CACHE *MetaCache, UINT64 ExpirationTime)
{
FSP_META_CACHE_ITEM *Item;
PLIST_ENTRY Head, Entry;
@ -107,16 +107,6 @@ static VOID MetaCacheInvalidateItems(FSP_META_CACHE *MetaCache, UINT64 Expiratio
}
}
VOID MetaCacheInvalidateAll(FSP_META_CACHE *MetaCache)
{
MetaCacheInvalidateItems(MetaCache, (UINT64)-1LL);
}
VOID MetaCacheInvalidateExpired(FSP_META_CACHE *MetaCache)
{
MetaCacheInvalidateItems(MetaCache, KeQueryInterruptTime());
}
PVOID MetaCacheReferenceItemBuffer(FSP_META_CACHE *MetaCache, UINT64 ItemIndex, PULONG PSize)
{
FSP_META_CACHE_ITEM *Item = 0;