MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / Ext2DestroyVcb

Function Ext2DestroyVcb

Ext4Fsd/memory.c:2805–2858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2803}
2804
2805VOID
2806Ext2DestroyVcb (IN PEXT2_VCB Vcb)
2807{
2808 ASSERT(Vcb != NULL);
2809 ASSERT((Vcb->Identifier.Type == EXT2VCB) &&
2810 (Vcb->Identifier.Size == sizeof(EXT2_VCB)));
2811
2812 DEBUG(DL_FUN, ("Ext2DestroyVcb ...\n"));
2813
2814 if (Vcb->Volume) {
2815 Ext2TearDownStream(Vcb);
2816 }
2817 ASSERT(NULL == Vcb->Volume);
2818
2819 FsRtlNotifyUninitializeSync(&Vcb->NotifySync);
2820 Ext2ListExtents(&Vcb->Extents);
2821 FsRtlUninitializeLargeMcb(&(Vcb->Extents));
2822
2823 Ext2CleanupAllMcbs(Vcb);
2824
2825 Ext2DropBH(Vcb);
2826
2827 if (Vcb->bd.bd_bh_cache)
2828 kmem_cache_destroy(Vcb->bd.bd_bh_cache);
2829 ExDeleteResourceLite(&Vcb->bd.bd_bh_lock);
2830
2831 if (Vcb->SuperBlock) {
2832 Ext2FreePool(Vcb->SuperBlock, EXT2_SB_MAGIC);
2833 Vcb->SuperBlock = NULL;
2834 }
2835
2836 if (IsFlagOn(Vcb->Flags, VCB_NEW_VPB)) {
2837 ASSERT(Vcb->Vpb2 != NULL);
2838 DEBUG(DL_DBG, ("Ext2DestroyVcb: Vpb2 to be freed: %p\n", Vcb->Vpb2));
2839 ExFreePoolWithTag(Vcb->Vpb2, TAG_VPB);
2840 DEC_MEM_COUNT(PS_VPB, Vcb->Vpb2, sizeof(VPB));
2841 Vcb->Vpb2 = NULL;
2842 }
2843
2844 ObDereferenceObject(Vcb->TargetDeviceObject);
2845
2846 ExDeleteNPagedLookasideList(&(Vcb->InodeLookasideList));
2847 ExDeleteResourceLite(&Vcb->FcbLock);
2848 ExDeleteResourceLite(&Vcb->McbLock);
2849 ExDeleteResourceLite(&Vcb->MetaInode);
2850 ExDeleteResourceLite(&Vcb->MetaBlock);
2851 ExDeleteResourceLite(&Vcb->sbi.s_gd_lock);
2852 ExDeleteResourceLite(&Vcb->PagingIoResource);
2853 ExDeleteResourceLite(&Vcb->MainResource);
2854
2855 DEBUG(DL_DBG, ("Ext2DestroyVcb: DevObject=%p Vcb=%p\n", Vcb->DeviceObject, Vcb));
2856 IoDeleteDevice(Vcb->DeviceObject);
2857 DEC_MEM_COUNT(PS_VCB, Vcb->DeviceObject, sizeof(EXT2_VCB));
2858}
2859
2860
2861/* uninitialize cache map */

Callers 3

Ext2MountVolumeFunction · 0.85
Ext2CheckDismountFunction · 0.85
Ext2PrepareToUnloadFunction · 0.85

Calls 6

Ext2TearDownStreamFunction · 0.85
Ext2ListExtentsFunction · 0.85
Ext2CleanupAllMcbsFunction · 0.85
Ext2DropBHFunction · 0.85
kmem_cache_destroyFunction · 0.85
Ext2FreePoolFunction · 0.85

Tested by

no test coverage detected