https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4bb1baa8607c60a4c75fa…
commit 4bb1baa8607c60a4c75fa580f477f654a2244540
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Tue Aug 21 08:36:51 2018 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Tue Aug 21 08:36:51 2018 +0200
[FASTFAT] Finally drop the TAG_VFAT allocation tag
---
drivers/filesystems/fastfat/create.c | 10 +++++-----
drivers/filesystems/fastfat/dir.c | 4 ++--
drivers/filesystems/fastfat/dirwr.c | 22 +++++++++++-----------
drivers/filesystems/fastfat/fcb.c | 2 +-
drivers/filesystems/fastfat/finfo.c | 6 +++---
drivers/filesystems/fastfat/fsctl.c | 18 +++++++++---------
drivers/filesystems/fastfat/vfat.h | 5 ++++-
7 files changed, 35 insertions(+), 32 deletions(-)
diff --git a/drivers/filesystems/fastfat/create.c b/drivers/filesystems/fastfat/create.c
index 6dbf032e6e..22ce0a54ff 100644
--- a/drivers/filesystems/fastfat/create.c
+++ b/drivers/filesystems/fastfat/create.c
@@ -122,7 +122,7 @@ FindFile(
DPRINT("FindFile: Path %wZ\n",&Parent->PathNameU);
PathNameBufferLength = LONGNAME_MAX_LENGTH * sizeof(WCHAR);
- PathNameBuffer = ExAllocatePoolWithTag(NonPagedPool, PathNameBufferLength +
sizeof(WCHAR), TAG_VFAT);
+ PathNameBuffer = ExAllocatePoolWithTag(NonPagedPool, PathNameBufferLength +
sizeof(WCHAR), TAG_NAME);
if (!PathNameBuffer)
{
return STATUS_INSUFFICIENT_RESOURCES;
@@ -173,7 +173,7 @@ FindFile(
Status = STATUS_UNSUCCESSFUL;
}
vfatReleaseFCB(DeviceExt, rcFcb);
- ExFreePool(PathNameBuffer);
+ ExFreePoolWithTag(PathNameBuffer, TAG_NAME);
return Status;
}
}
@@ -183,7 +183,7 @@ FindFile(
Status = RtlUpcaseUnicodeString(&FileToFindUpcase, FileToFindU, TRUE);
if (!NT_SUCCESS(Status))
{
- ExFreePool(PathNameBuffer);
+ ExFreePoolWithTag(PathNameBuffer, TAG_NAME);
return Status;
}
@@ -251,7 +251,7 @@ FindFile(
CcUnpinData(Context);
}
RtlFreeUnicodeString(&FileToFindUpcase);
- ExFreePool(PathNameBuffer);
+ ExFreePoolWithTag(PathNameBuffer, TAG_NAME);
return STATUS_SUCCESS;
}
DirContext->DirIndex++;
@@ -263,7 +263,7 @@ FindFile(
}
RtlFreeUnicodeString(&FileToFindUpcase);
- ExFreePool(PathNameBuffer);
+ ExFreePoolWithTag(PathNameBuffer, TAG_NAME);
return Status;
}
diff --git a/drivers/filesystems/fastfat/dir.c b/drivers/filesystems/fastfat/dir.c
index b0b442a33a..fc78f7cbe1 100644
--- a/drivers/filesystems/fastfat/dir.c
+++ b/drivers/filesystems/fastfat/dir.c
@@ -555,7 +555,7 @@ DoQuery(
pCcb->SearchPattern.MaximumLength = pSearchPattern->Length +
sizeof(WCHAR);
pCcb->SearchPattern.Buffer = ExAllocatePoolWithTag(NonPagedPool,
pCcb->SearchPattern.MaximumLength,
- TAG_VFAT);
+ TAG_SEARCH);
if (!pCcb->SearchPattern.Buffer)
{
ExReleaseResourceLite(&pFcb->MainResource);
@@ -572,7 +572,7 @@ DoQuery(
pCcb->SearchPattern.MaximumLength = 2 * sizeof(WCHAR);
pCcb->SearchPattern.Buffer = ExAllocatePoolWithTag(NonPagedPool,
2 * sizeof(WCHAR),
- TAG_VFAT);
+ TAG_SEARCH);
if (!pCcb->SearchPattern.Buffer)
{
ExReleaseResourceLite(&pFcb->MainResource);
diff --git a/drivers/filesystems/fastfat/dirwr.c b/drivers/filesystems/fastfat/dirwr.c
index ba791fbc60..65db414d21 100644
--- a/drivers/filesystems/fastfat/dirwr.c
+++ b/drivers/filesystems/fastfat/dirwr.c
@@ -445,7 +445,7 @@ FATAddEntry(
/* nb of entry needed for long name+normal entry */
nbSlots = (DirContext.LongNameU.Length / sizeof(WCHAR) + 12) / 13 + 1;
DPRINT("NameLen= %u, nbSlots =%u\n", DirContext.LongNameU.Length /
sizeof(WCHAR), nbSlots);
- Buffer = ExAllocatePoolWithTag(NonPagedPool, (nbSlots - 1) * sizeof(FAT_DIR_ENTRY),
TAG_VFAT);
+ Buffer = ExAllocatePoolWithTag(NonPagedPool, (nbSlots - 1) * sizeof(FAT_DIR_ENTRY),
TAG_DIRENT);
if (Buffer == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
@@ -505,7 +505,7 @@ FATAddEntry(
}
if (i == 100) /* FIXME : what to do after this ? */
{
- ExFreePoolWithTag(Buffer, TAG_VFAT);
+ ExFreePoolWithTag(Buffer, TAG_DIRENT);
return STATUS_UNSUCCESSFUL;
}
IsNameLegal = RtlIsNameLegalDOS8Dot3(&DirContext.ShortNameU, &NameA,
&SpacesFound);
@@ -650,7 +650,7 @@ FATAddEntry(
/* try to find nbSlots contiguous entries frees in directory */
if (!vfatFindDirSpace(DeviceExt, ParentFcb, nbSlots, &DirContext.StartIndex))
{
- ExFreePoolWithTag(Buffer, TAG_VFAT);
+ ExFreePoolWithTag(Buffer, TAG_DIRENT);
return STATUS_DISK_FULL;
}
DirContext.DirIndex = DirContext.StartIndex + nbSlots - 1;
@@ -663,7 +663,7 @@ FATAddEntry(
Status = NextCluster(DeviceExt, 0, &CurrentCluster, TRUE);
if (CurrentCluster == 0xffffffff || !NT_SUCCESS(Status))
{
- ExFreePoolWithTag(Buffer, TAG_VFAT);
+ ExFreePoolWithTag(Buffer, TAG_DIRENT);
if (!NT_SUCCESS(Status))
{
return Status;
@@ -713,7 +713,7 @@ FATAddEntry(
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- ExFreePoolWithTag(Buffer, TAG_VFAT);
+ ExFreePoolWithTag(Buffer, TAG_DIRENT);
_SEH2_YIELD(return _SEH2_GetExceptionCode());
}
_SEH2_END;
@@ -736,7 +736,7 @@ FATAddEntry(
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- ExFreePoolWithTag(Buffer, TAG_VFAT);
+ ExFreePoolWithTag(Buffer, TAG_DIRENT);
_SEH2_YIELD(return _SEH2_GetExceptionCode());
}
_SEH2_END;
@@ -750,7 +750,7 @@ FATAddEntry(
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- ExFreePoolWithTag(Buffer, TAG_VFAT);
+ ExFreePoolWithTag(Buffer, TAG_DIRENT);
_SEH2_YIELD(return _SEH2_GetExceptionCode());
}
_SEH2_END;
@@ -774,7 +774,7 @@ FATAddEntry(
}
if (!NT_SUCCESS(Status))
{
- ExFreePoolWithTag(Buffer, TAG_VFAT);
+ ExFreePoolWithTag(Buffer, TAG_DIRENT);
return Status;
}
@@ -786,7 +786,7 @@ FATAddEntry(
Status = vfatFCBInitializeCacheFromVolume(DeviceExt, (*Fcb));
if (!NT_SUCCESS(Status))
{
- ExFreePoolWithTag(Buffer, TAG_VFAT);
+ ExFreePoolWithTag(Buffer, TAG_DIRENT);
return Status;
}
@@ -797,7 +797,7 @@ FATAddEntry(
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- ExFreePoolWithTag(Buffer, TAG_VFAT);
+ ExFreePoolWithTag(Buffer, TAG_DIRENT);
_SEH2_YIELD(return _SEH2_GetExceptionCode());
}
_SEH2_END;
@@ -824,7 +824,7 @@ FATAddEntry(
CcSetDirtyPinnedData(Context, NULL);
CcUnpinData(Context);
}
- ExFreePoolWithTag(Buffer, TAG_VFAT);
+ ExFreePoolWithTag(Buffer, TAG_DIRENT);
DPRINT("addentry ok\n");
return STATUS_SUCCESS;
}
diff --git a/drivers/filesystems/fastfat/fcb.c b/drivers/filesystems/fastfat/fcb.c
index 6befca9128..ed85ab277c 100644
--- a/drivers/filesystems/fastfat/fcb.c
+++ b/drivers/filesystems/fastfat/fcb.c
@@ -260,7 +260,7 @@ vfatDestroyCCB(
{
if (pCcb->SearchPattern.Buffer)
{
- ExFreePoolWithTag(pCcb->SearchPattern.Buffer, TAG_VFAT);
+ ExFreePoolWithTag(pCcb->SearchPattern.Buffer, TAG_SEARCH);
}
ExFreeToNPagedLookasideList(&VfatGlobalData->CcbLookasideList, pCcb);
}
diff --git a/drivers/filesystems/fastfat/finfo.c b/drivers/filesystems/fastfat/finfo.c
index a19c21db55..576adb2e18 100644
--- a/drivers/filesystems/fastfat/finfo.c
+++ b/drivers/filesystems/fastfat/finfo.c
@@ -713,7 +713,7 @@ VfatSetRenameInformation(
NewName.MaximumLength += sizeof(WCHAR) +
((PVFATFCB)TargetFileObject->FsContext)->PathNameU.Length;
}
- NewName.Buffer = ExAllocatePoolWithTag(NonPagedPool, NewName.MaximumLength,
TAG_VFAT);
+ NewName.Buffer = ExAllocatePoolWithTag(NonPagedPool, NewName.MaximumLength,
TAG_NAME);
if (NewName.Buffer == NULL)
{
if (TargetFileObject != NULL)
@@ -779,7 +779,7 @@ VfatSetRenameInformation(
NewName.Length = 0;
NewName.MaximumLength = TargetFileObject->FileName.Length +
((PVFATFCB)TargetFileObject->FsContext)->PathNameU.Length + sizeof(WCHAR);
- NewName.Buffer = ExAllocatePoolWithTag(NonPagedPool, NewName.MaximumLength,
TAG_VFAT);
+ NewName.Buffer = ExAllocatePoolWithTag(NonPagedPool, NewName.MaximumLength,
TAG_NAME);
if (NewName.Buffer == NULL)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
@@ -949,7 +949,7 @@ VfatSetRenameInformation(
ASSERT(NewReferences == ParentFCB->RefCount - 1); // new file
Cleanup:
if (ParentFCB != NULL) vfatReleaseFCB(DeviceExt, ParentFCB);
- if (NewName.Buffer != NULL) ExFreePoolWithTag(NewName.Buffer, TAG_VFAT);
+ if (NewName.Buffer != NULL) ExFreePoolWithTag(NewName.Buffer, TAG_NAME);
if (RenameInfo->RootDirectory != NULL) ObDereferenceObject(RootFileObject);
return Status;
diff --git a/drivers/filesystems/fastfat/fsctl.c b/drivers/filesystems/fastfat/fsctl.c
index b70a84cd7e..b7e576d2d8 100644
--- a/drivers/filesystems/fastfat/fsctl.c
+++ b/drivers/filesystems/fastfat/fsctl.c
@@ -132,7 +132,7 @@ VfatHasFileSystem(
if (*RecognizedFS)
{
- Boot = ExAllocatePoolWithTag(NonPagedPool, DiskGeometry.BytesPerSector,
TAG_VFAT);
+ Boot = ExAllocatePoolWithTag(NonPagedPool, DiskGeometry.BytesPerSector,
TAG_BUFFER);
if (Boot == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
@@ -256,12 +256,12 @@ VfatHasFileSystem(
}
}
- ExFreePool(Boot);
+ ExFreePoolWithTag(Boot, TAG_BUFFER);
}
if (!*RecognizedFS && PartitionInfoIsValid)
{
- BootFatX = ExAllocatePoolWithTag(NonPagedPool, sizeof(struct _BootSectorFatX),
TAG_VFAT);
+ BootFatX = ExAllocatePoolWithTag(NonPagedPool, sizeof(struct _BootSectorFatX),
TAG_BUFFER);
if (BootFatX == NULL)
{
*RecognizedFS=FALSE;
@@ -332,7 +332,7 @@ VfatHasFileSystem(
}
}
}
- ExFreePool(BootFatX);
+ ExFreePoolWithTag(BootFatX, TAG_BUFFER);
}
DPRINT("VfatHasFileSystem done\n");
@@ -412,13 +412,13 @@ ReadVolumeLabel(
ASSERT(DeviceObject->Type == 3);
- Buffer = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, TAG_VFAT);
+ Buffer = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, TAG_DIRENT);
if (Buffer != NULL)
{
Status = VfatReadDisk(DeviceObject, &FileOffset, PAGE_SIZE,
(PUCHAR)Buffer, TRUE);
if (!NT_SUCCESS(Status))
{
- ExFreePoolWithTag(Buffer, TAG_VFAT);
+ ExFreePoolWithTag(Buffer, TAG_DIRENT);
}
else
{
@@ -496,7 +496,7 @@ ReadVolumeLabel(
}
else if (NoCache)
{
- ExFreePoolWithTag(Buffer, TAG_VFAT);
+ ExFreePoolWithTag(Buffer, TAG_DIRENT);
}
}
@@ -668,7 +668,7 @@ VfatMount(
ExInitializeResourceLite(&DeviceExt->DirResource);
DeviceExt->IoVPB = DeviceObject->Vpb;
- DeviceExt->SpareVPB = ExAllocatePoolWithTag(NonPagedPool, sizeof(VPB), TAG_VFAT);
+ DeviceExt->SpareVPB = ExAllocatePoolWithTag(NonPagedPool, sizeof(VPB), TAG_VPB);
if (DeviceExt->SpareVPB == NULL)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
@@ -807,7 +807,7 @@ ByeBye:
if (DeviceExt && DeviceExt->FATFileObject)
ObDereferenceObject (DeviceExt->FATFileObject);
if (DeviceExt && DeviceExt->SpareVPB)
- ExFreePoolWithTag(DeviceExt->SpareVPB, TAG_VFAT);
+ ExFreePoolWithTag(DeviceExt->SpareVPB, TAG_VPB);
if (DeviceExt && DeviceExt->Statistics)
ExFreePoolWithTag(DeviceExt->Statistics, TAG_STATS);
if (Fcb)
diff --git a/drivers/filesystems/fastfat/vfat.h b/drivers/filesystems/fastfat/vfat.h
index 993d5f9fb9..e6c7c73e1d 100644
--- a/drivers/filesystems/fastfat/vfat.h
+++ b/drivers/filesystems/fastfat/vfat.h
@@ -538,10 +538,13 @@ typedef struct _VFATCCB
#define TAG_CCB 'CtaF'
#define TAG_FCB 'FtaF'
#define TAG_IRP 'ItaF'
-#define TAG_VFAT 'TAFV'
#define TAG_CLOSE 'xtaF'
#define TAG_STATS 'VtaF'
#define TAG_BUFFER 'OtaF'
+#define TAG_VPB 'vtaF'
+#define TAG_NAME 'ntaF'
+#define TAG_SEARCH 'LtaF'
+#define TAG_DIRENT 'DtaF'
#define ENTRIES_PER_SECTOR (BLOCKSIZE / sizeof(FATDirEntry))