sys: FSP_FSVOL_DEVICE_EXTENSION: rename GenericTable to ContextTable

This commit is contained in:
Bill Zissimopoulos 2016-02-05 23:59:41 -08:00
parent f65e2059e4
commit 3ccf00bd4e
2 changed files with 21 additions and 21 deletions

View File

@ -294,10 +294,10 @@ static NTSTATUS FspFsvolDeviceInit(PDEVICE_OBJECT DeviceObject)
FsvolDeviceExtension->InitDoneIoq = 1; FsvolDeviceExtension->InitDoneIoq = 1;
/* initialize our generic table */ /* initialize our generic table */
ExInitializeResourceLite(&FsvolDeviceExtension->GenericTableResource); ExInitializeResourceLite(&FsvolDeviceExtension->ContextTableResource);
RtlInitializeGenericTableAvl(&FsvolDeviceExtension->GenericTable, RtlInitializeGenericTableAvl(&FsvolDeviceExtension->ContextTable,
FspFsvolDeviceCompareElement, FspFsvolDeviceAllocateElement, FspFsvolDeviceFreeElement, 0); FspFsvolDeviceCompareElement, FspFsvolDeviceAllocateElement, FspFsvolDeviceFreeElement, 0);
FsvolDeviceExtension->InitDoneGenTab = 1; FsvolDeviceExtension->InitDoneCtxTab = 1;
/* initialize our timer routine and start our expiration timer */ /* initialize our timer routine and start our expiration timer */
#pragma prefast(suppress:28133, "We are a filesystem: we do not have AddDevice") #pragma prefast(suppress:28133, "We are a filesystem: we do not have AddDevice")
@ -337,19 +337,19 @@ static VOID FspFsvolDeviceFini(PDEVICE_OBJECT DeviceObject)
if (FsvolDeviceExtension->InitDoneIoq) if (FsvolDeviceExtension->InitDoneIoq)
FspIoqDelete(FsvolDeviceExtension->Ioq); FspIoqDelete(FsvolDeviceExtension->Ioq);
if (FsvolDeviceExtension->InitDoneGenTab) if (FsvolDeviceExtension->InitDoneCtxTab)
{ {
#if 0 #if 0
/* FspDeviceFreeElement is now a no-op, so this is no longer necessary */ /* FspDeviceFreeElement is now a no-op, so this is no longer necessary */
/* /*
* Enumerate and delete all entries in the GenericTable. * Enumerate and delete all entries in the ContextTable.
* There is no need to protect accesses to the table as we are in the device destructor. * There is no need to protect accesses to the table as we are in the device destructor.
*/ */
FSP_DEVICE_GENERIC_TABLE_ELEMENT_DATA *Element; FSP_DEVICE_GENERIC_TABLE_ELEMENT_DATA *Element;
while (0 != (Element = RtlGetElementGenericTableAvl(&FsvolDeviceExtension->GenericTable, 0))) while (0 != (Element = RtlGetElementGenericTableAvl(&FsvolDeviceExtension->ContextTable, 0)))
RtlDeleteElementGenericTableAvl(&FsvolDeviceExtension->GenericTable, &Element->Identifier); RtlDeleteElementGenericTableAvl(&FsvolDeviceExtension->ContextTable, &Element->Identifier);
#endif #endif
ExDeleteResourceLite(&FsvolDeviceExtension->GenericTableResource); ExDeleteResourceLite(&FsvolDeviceExtension->ContextTableResource);
} }
/* finalize our delete lock */ /* finalize our delete lock */
@ -421,7 +421,7 @@ VOID FspFsvolDeviceLockContextTable(PDEVICE_OBJECT DeviceObject)
PAGED_CODE(); PAGED_CODE();
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject); FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject);
ExAcquireResourceExclusiveLite(&FsvolDeviceExtension->GenericTableResource, TRUE); ExAcquireResourceExclusiveLite(&FsvolDeviceExtension->ContextTableResource, TRUE);
} }
VOID FspFsvolDeviceUnlockContextTable(PDEVICE_OBJECT DeviceObject) VOID FspFsvolDeviceUnlockContextTable(PDEVICE_OBJECT DeviceObject)
@ -429,7 +429,7 @@ VOID FspFsvolDeviceUnlockContextTable(PDEVICE_OBJECT DeviceObject)
PAGED_CODE(); PAGED_CODE();
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject); FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject);
ExReleaseResourceLite(&FsvolDeviceExtension->GenericTableResource); ExReleaseResourceLite(&FsvolDeviceExtension->ContextTableResource);
} }
PVOID FspFsvolDeviceLookupContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier) PVOID FspFsvolDeviceLookupContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier)
@ -439,7 +439,7 @@ PVOID FspFsvolDeviceLookupContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject); FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject);
FSP_DEVICE_GENERIC_TABLE_ELEMENT_DATA *Result; FSP_DEVICE_GENERIC_TABLE_ELEMENT_DATA *Result;
Result = RtlLookupElementGenericTableAvl(&FsvolDeviceExtension->GenericTable, &Identifier); Result = RtlLookupElementGenericTableAvl(&FsvolDeviceExtension->ContextTable, &Identifier);
return 0 != Result ? Result->Context : 0; return 0 != Result ? Result->Context : 0;
} }
@ -456,10 +456,10 @@ PVOID FspFsvolDeviceInsertContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier
Element.Identifier = Identifier; Element.Identifier = Identifier;
Element.Context = Context; Element.Context = Context;
FsvolDeviceExtension->GenericTableElementStorage = ElementStorage; FsvolDeviceExtension->ContextTableElementStorage = ElementStorage;
Result = RtlInsertElementGenericTableAvl(&FsvolDeviceExtension->GenericTable, Result = RtlInsertElementGenericTableAvl(&FsvolDeviceExtension->ContextTable,
&Element, sizeof Element, PInserted); &Element, sizeof Element, PInserted);
FsvolDeviceExtension->GenericTableElementStorage = 0; FsvolDeviceExtension->ContextTableElementStorage = 0;
ASSERT(0 != Result); ASSERT(0 != Result);
@ -474,7 +474,7 @@ VOID FspFsvolDeviceDeleteContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier,
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject); FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject);
BOOLEAN Deleted; BOOLEAN Deleted;
Deleted = RtlDeleteElementGenericTableAvl(&FsvolDeviceExtension->GenericTable, &Identifier); Deleted = RtlDeleteElementGenericTableAvl(&FsvolDeviceExtension->ContextTable, &Identifier);
if (0 != PDeleted) if (0 != PDeleted)
*PDeleted = Deleted; *PDeleted = Deleted;
@ -503,11 +503,11 @@ static PVOID NTAPI FspFsvolDeviceAllocateElement(
PAGED_CODE(); PAGED_CODE();
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension =
CONTAINING_RECORD(Table, FSP_FSVOL_DEVICE_EXTENSION, GenericTable); CONTAINING_RECORD(Table, FSP_FSVOL_DEVICE_EXTENSION, ContextTable);
ASSERT(sizeof(FSP_DEVICE_GENERIC_TABLE_ELEMENT) == ByteSize); ASSERT(sizeof(FSP_DEVICE_GENERIC_TABLE_ELEMENT) == ByteSize);
return FsvolDeviceExtension->GenericTableElementStorage; return FsvolDeviceExtension->ContextTableElementStorage;
} }
static VOID NTAPI FspFsvolDeviceFreeElement( static VOID NTAPI FspFsvolDeviceFreeElement(

View File

@ -464,7 +464,7 @@ typedef struct
typedef struct typedef struct
{ {
FSP_DEVICE_EXTENSION Base; FSP_DEVICE_EXTENSION Base;
UINT32 InitDoneFsvrt:1, InitDoneDelRsc:1, InitDoneIoq:1, InitDoneGenTab:1, InitDoneTimer:1, UINT32 InitDoneFsvrt:1, InitDoneDelRsc:1, InitDoneIoq:1, InitDoneCtxTab:1, InitDoneTimer:1,
InitDoneInfo:1; InitDoneInfo:1;
PDEVICE_OBJECT FsctlDeviceObject; PDEVICE_OBJECT FsctlDeviceObject;
PDEVICE_OBJECT FsvrtDeviceObject; PDEVICE_OBJECT FsvrtDeviceObject;
@ -478,9 +478,9 @@ typedef struct
KSPIN_LOCK ExpirationLock; KSPIN_LOCK ExpirationLock;
WORK_QUEUE_ITEM ExpirationWorkItem; WORK_QUEUE_ITEM ExpirationWorkItem;
BOOLEAN ExpirationInProgress; BOOLEAN ExpirationInProgress;
ERESOURCE GenericTableResource; ERESOURCE ContextTableResource;
RTL_AVL_TABLE GenericTable; RTL_AVL_TABLE ContextTable;
PVOID GenericTableElementStorage; PVOID ContextTableElementStorage;
UNICODE_STRING VolumeName; UNICODE_STRING VolumeName;
WCHAR VolumeNameBuf[FSP_DEVICE_VOLUME_NAME_LENMAX / sizeof(WCHAR)]; WCHAR VolumeNameBuf[FSP_DEVICE_VOLUME_NAME_LENMAX / sizeof(WCHAR)];
KSPIN_LOCK InfoSpinLock; KSPIN_LOCK InfoSpinLock;