Skip to content

Commit 639e6d6

Browse files
committed
[FASTFAT] Reduce the usage of the generic allocation tag
And use tag compatible with MS FastFAT, to use debug with WinDBG
1 parent 50b00f0 commit 639e6d6

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

drivers/filesystems/fastfat/fat.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ FAT16GetDirtyStatus(
891891
* - Allocate a big enough buffer
892892
* - And read the disk
893893
*/
894-
Sector = ExAllocatePoolWithTag(NonPagedPool, Length, TAG_VFAT);
894+
Sector = ExAllocatePoolWithTag(NonPagedPool, Length, TAG_BUFFER);
895895
if (Sector == NULL)
896896
{
897897
*DirtyStatus = TRUE;
@@ -902,7 +902,7 @@ FAT16GetDirtyStatus(
902902
if (!NT_SUCCESS(Status))
903903
{
904904
*DirtyStatus = TRUE;
905-
ExFreePoolWithTag(Sector, TAG_VFAT);
905+
ExFreePoolWithTag(Sector, TAG_BUFFER);
906906
return Status;
907907
}
908908
#endif
@@ -917,7 +917,7 @@ FAT16GetDirtyStatus(
917917
#ifndef VOLUME_IS_NOT_CACHED_WORK_AROUND_IT
918918
CcUnpinData(Context);
919919
#else
920-
ExFreePoolWithTag(Sector, TAG_VFAT);
920+
ExFreePoolWithTag(Sector, TAG_BUFFER);
921921
#endif
922922
return STATUS_DISK_CORRUPT_ERROR;
923923
}
@@ -931,7 +931,7 @@ FAT16GetDirtyStatus(
931931
#ifndef VOLUME_IS_NOT_CACHED_WORK_AROUND_IT
932932
CcUnpinData(Context);
933933
#else
934-
ExFreePoolWithTag(Sector, TAG_VFAT);
934+
ExFreePoolWithTag(Sector, TAG_BUFFER);
935935
#endif
936936
return STATUS_SUCCESS;
937937
}
@@ -969,7 +969,7 @@ FAT32GetDirtyStatus(
969969
* - Allocate a big enough buffer
970970
* - And read the disk
971971
*/
972-
Sector = ExAllocatePoolWithTag(NonPagedPool, Length, TAG_VFAT);
972+
Sector = ExAllocatePoolWithTag(NonPagedPool, Length, TAG_BUFFER);
973973
if (Sector == NULL)
974974
{
975975
*DirtyStatus = TRUE;
@@ -980,7 +980,7 @@ FAT32GetDirtyStatus(
980980
if (!NT_SUCCESS(Status))
981981
{
982982
*DirtyStatus = TRUE;
983-
ExFreePoolWithTag(Sector, TAG_VFAT);
983+
ExFreePoolWithTag(Sector, TAG_BUFFER);
984984
return Status;
985985
}
986986
#endif
@@ -995,7 +995,7 @@ FAT32GetDirtyStatus(
995995
#ifndef VOLUME_IS_NOT_CACHED_WORK_AROUND_IT
996996
CcUnpinData(Context);
997997
#else
998-
ExFreePoolWithTag(Sector, TAG_VFAT);
998+
ExFreePoolWithTag(Sector, TAG_BUFFER);
999999
#endif
10001000
return STATUS_DISK_CORRUPT_ERROR;
10011001
}
@@ -1009,7 +1009,7 @@ FAT32GetDirtyStatus(
10091009
#ifndef VOLUME_IS_NOT_CACHED_WORK_AROUND_IT
10101010
CcUnpinData(Context);
10111011
#else
1012-
ExFreePoolWithTag(Sector, TAG_VFAT);
1012+
ExFreePoolWithTag(Sector, TAG_BUFFER);
10131013
#endif
10141014
return STATUS_SUCCESS;
10151015
}
@@ -1077,7 +1077,7 @@ FAT16SetDirtyStatus(
10771077
* - Allocate a big enough buffer
10781078
* - And read the disk
10791079
*/
1080-
Sector = ExAllocatePoolWithTag(NonPagedPool, Length, TAG_VFAT);
1080+
Sector = ExAllocatePoolWithTag(NonPagedPool, Length, TAG_BUFFER);
10811081
if (Sector == NULL)
10821082
{
10831083
return STATUS_INSUFFICIENT_RESOURCES;
@@ -1086,7 +1086,7 @@ FAT16SetDirtyStatus(
10861086
Status = VfatReadDisk(DeviceExt->StorageDevice, &Offset, Length, (PUCHAR)Sector, FALSE);
10871087
if (!NT_SUCCESS(Status))
10881088
{
1089-
ExFreePoolWithTag(Sector, TAG_VFAT);
1089+
ExFreePoolWithTag(Sector, TAG_BUFFER);
10901090
return Status;
10911091
}
10921092
#endif
@@ -1099,7 +1099,7 @@ FAT16SetDirtyStatus(
10991099
#ifndef VOLUME_IS_NOT_CACHED_WORK_AROUND_IT
11001100
CcUnpinData(Context);
11011101
#else
1102-
ExFreePoolWithTag(Sector, TAG_VFAT);
1102+
ExFreePoolWithTag(Sector, TAG_BUFFER);
11031103
#endif
11041104
return STATUS_DISK_CORRUPT_ERROR;
11051105
}
@@ -1124,7 +1124,7 @@ FAT16SetDirtyStatus(
11241124
#else
11251125
/* Write back the boot sector to the disk */
11261126
Status = VfatWriteDisk(DeviceExt->StorageDevice, &Offset, Length, (PUCHAR)Sector, FALSE);
1127-
ExFreePoolWithTag(Sector, TAG_VFAT);
1127+
ExFreePoolWithTag(Sector, TAG_BUFFER);
11281128
return Status;
11291129
#endif
11301130
}
@@ -1162,7 +1162,7 @@ FAT32SetDirtyStatus(
11621162
* - Allocate a big enough buffer
11631163
* - And read the disk
11641164
*/
1165-
Sector = ExAllocatePoolWithTag(NonPagedPool, Length, TAG_VFAT);
1165+
Sector = ExAllocatePoolWithTag(NonPagedPool, Length, TAG_BUFFER);
11661166
if (Sector == NULL)
11671167
{
11681168
return STATUS_INSUFFICIENT_RESOURCES;
@@ -1171,7 +1171,7 @@ FAT32SetDirtyStatus(
11711171
Status = VfatReadDisk(DeviceExt->StorageDevice, &Offset, Length, (PUCHAR)Sector, FALSE);
11721172
if (!NT_SUCCESS(Status))
11731173
{
1174-
ExFreePoolWithTag(Sector, TAG_VFAT);
1174+
ExFreePoolWithTag(Sector, TAG_BUFFER);
11751175
return Status;
11761176
}
11771177
#endif
@@ -1185,7 +1185,7 @@ FAT32SetDirtyStatus(
11851185
#ifndef VOLUME_IS_NOT_CACHED_WORK_AROUND_IT
11861186
CcUnpinData(Context);
11871187
#else
1188-
ExFreePoolWithTag(Sector, TAG_VFAT);
1188+
ExFreePoolWithTag(Sector, TAG_BUFFER);
11891189
#endif
11901190
return STATUS_DISK_CORRUPT_ERROR;
11911191
}
@@ -1210,7 +1210,7 @@ FAT32SetDirtyStatus(
12101210
#else
12111211
/* Write back the boot sector to the disk */
12121212
Status = VfatWriteDisk(DeviceExt->StorageDevice, &Offset, Length, (PUCHAR)Sector, FALSE);
1213-
ExFreePoolWithTag(Sector, TAG_VFAT);
1213+
ExFreePoolWithTag(Sector, TAG_BUFFER);
12141214
return Status;
12151215
#endif
12161216
}
@@ -1252,7 +1252,7 @@ FAT32UpdateFreeClustersCount(
12521252
* - Allocate a big enough buffer
12531253
* - And read the disk
12541254
*/
1255-
Sector = ExAllocatePoolWithTag(NonPagedPool, Length, TAG_VFAT);
1255+
Sector = ExAllocatePoolWithTag(NonPagedPool, Length, TAG_BUFFER);
12561256
if (Sector == NULL)
12571257
{
12581258
return STATUS_INSUFFICIENT_RESOURCES;
@@ -1261,7 +1261,7 @@ FAT32UpdateFreeClustersCount(
12611261
Status = VfatReadDisk(DeviceExt->StorageDevice, &Offset, Length, (PUCHAR)Sector, FALSE);
12621262
if (!NT_SUCCESS(Status))
12631263
{
1264-
ExFreePoolWithTag(Sector, TAG_VFAT);
1264+
ExFreePoolWithTag(Sector, TAG_BUFFER);
12651265
return Status;
12661266
}
12671267
#endif
@@ -1275,7 +1275,7 @@ FAT32UpdateFreeClustersCount(
12751275
#ifndef VOLUME_IS_NOT_CACHED_WORK_AROUND_IT
12761276
CcUnpinData(Context);
12771277
#else
1278-
ExFreePoolWithTag(Sector, TAG_VFAT);
1278+
ExFreePoolWithTag(Sector, TAG_BUFFER);
12791279
#endif
12801280
return STATUS_DISK_CORRUPT_ERROR;
12811281
}
@@ -1291,7 +1291,7 @@ FAT32UpdateFreeClustersCount(
12911291
#else
12921292
/* Write back the FSINFO sector to the disk */
12931293
Status = VfatWriteDisk(DeviceExt->StorageDevice, &Offset, Length, (PUCHAR)Sector, FALSE);
1294-
ExFreePoolWithTag(Sector, TAG_VFAT);
1294+
ExFreePoolWithTag(Sector, TAG_BUFFER);
12951295
return Status;
12961296
#endif
12971297
}

drivers/filesystems/fastfat/fcb.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
/* -------------------------------------------------------- DEFINES */
2424

25-
#define TAG_FCB 'BCFV'
26-
2725
#ifdef KDBG
2826
extern UNICODE_STRING DebugFile;
2927
#endif

drivers/filesystems/fastfat/fsctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ VfatMount(
677677

678678
DeviceExt->Statistics = ExAllocatePoolWithTag(NonPagedPool,
679679
sizeof(STATISTICS) * VfatGlobalData->NumberProcessors,
680-
TAG_VFAT);
680+
TAG_STATS);
681681
if (DeviceExt->Statistics == NULL)
682682
{
683683
Status = STATUS_INSUFFICIENT_RESOURCES;
@@ -809,7 +809,7 @@ VfatMount(
809809
if (DeviceExt && DeviceExt->SpareVPB)
810810
ExFreePoolWithTag(DeviceExt->SpareVPB, TAG_VFAT);
811811
if (DeviceExt && DeviceExt->Statistics)
812-
ExFreePoolWithTag(DeviceExt->Statistics, TAG_VFAT);
812+
ExFreePoolWithTag(DeviceExt->Statistics, TAG_STATS);
813813
if (Fcb)
814814
vfatDestroyFCB(Fcb);
815815
if (Ccb)

drivers/filesystems/fastfat/vfat.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,11 +534,13 @@ typedef struct _VFATCCB
534534
UNICODE_STRING SearchPattern;
535535
} VFATCCB, *PVFATCCB;
536536

537-
#define TAG_CCB 'BCCV'
538-
#define TAG_FCB 'BCFV'
539-
#define TAG_IRP 'PRIV'
537+
#define TAG_CCB 'CtaF'
538+
#define TAG_FCB 'FtaF'
539+
#define TAG_IRP 'ItaF'
540540
#define TAG_VFAT 'TAFV'
541541
#define TAG_CLOSE 'xtaF'
542+
#define TAG_STATS 'VtaF'
543+
#define TAG_BUFFER 'OtaF'
542544

543545
#define ENTRIES_PER_SECTOR (BLOCKSIZE / sizeof(FATDirEntry))
544546

0 commit comments

Comments
 (0)