Author: pschweitzer
Date: Wed Aug 12 16:47:18 2015
New Revision: 68704
URL:
http://svn.reactos.org/svn/reactos?rev=68704&view=rev
Log:
[FASTFAT]
- Remove some magic values
- Fix DPRINTs
Modified:
trunk/reactos/drivers/filesystems/fastfat/fat.c
Modified: trunk/reactos/drivers/filesystems/fastfat/fat.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/fat.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/fat.c [iso-8859-1] Wed Aug 12 16:47:18 2015
@@ -40,7 +40,7 @@
ChunkSize = CACHEPAGESIZE(DeviceExt);
FATOffset = CurrentCluster * sizeof(ULONG);
Offset.QuadPart = ROUND_DOWN(FATOffset, ChunkSize);
- if (!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context,
&BaseAddress))
+ if (!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, MAP_WAIT,
&Context, &BaseAddress))
{
return STATUS_UNSUCCESSFUL;
}
@@ -105,7 +105,7 @@
*NextCluster = 0;
Offset.QuadPart = 0;
- if (!CcMapData(DeviceExt->FATFileObject, &Offset,
DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector, 1, &Context,
&BaseAddress))
+ if (!CcMapData(DeviceExt->FATFileObject, &Offset,
DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector, MAP_WAIT,
&Context, &BaseAddress))
{
return STATUS_UNSUCCESSFUL;
}
@@ -160,9 +160,9 @@
for (i = StartCluster; i < FatLength;)
{
Offset.QuadPart = ROUND_DOWN(i * 2, ChunkSize);
- if (!CcPinRead(DeviceExt->FATFileObject, &Offset, ChunkSize, 1,
&Context, &BaseAddress))
+ if (!CcPinRead(DeviceExt->FATFileObject, &Offset, ChunkSize, PIN_WAIT,
&Context, &BaseAddress))
{
- DPRINT1("CcMapData(Offset %x, Length %u) failed\n",
(ULONG)Offset.QuadPart, ChunkSize);
+ DPRINT1("CcPinRead(Offset %x, Length %u) failed\n",
(ULONG)Offset.QuadPart, ChunkSize);
return STATUS_UNSUCCESSFUL;
}
@@ -219,9 +219,9 @@
*Cluster = 0;
StartCluster = DeviceExt->LastAvailableCluster;
Offset.QuadPart = 0;
- if (!CcPinRead(DeviceExt->FATFileObject, &Offset,
DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector, 1, &Context,
&BaseAddress))
- {
- DPRINT1("CcMapData(Offset %x, Length %u) failed\n",
(ULONG)Offset.QuadPart, DeviceExt->FatInfo.FATSectors *
DeviceExt->FatInfo.BytesPerSector);
+ if (!CcPinRead(DeviceExt->FATFileObject, &Offset,
DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector, PIN_WAIT,
&Context, &BaseAddress))
+ {
+ DPRINT1("CcPinRead(Offset %x, Length %u) failed\n",
(ULONG)Offset.QuadPart, DeviceExt->FatInfo.FATSectors *
DeviceExt->FatInfo.BytesPerSector);
return STATUS_UNSUCCESSFUL;
}
@@ -289,9 +289,9 @@
for (i = StartCluster; i < FatLength;)
{
Offset.QuadPart = ROUND_DOWN(i * 4, ChunkSize);
- if (!CcPinRead(DeviceExt->FATFileObject, &Offset, ChunkSize, 1,
&Context, &BaseAddress))
+ if (!CcPinRead(DeviceExt->FATFileObject, &Offset, ChunkSize, PIN_WAIT,
&Context, &BaseAddress))
{
- DPRINT1("CcMapData(Offset %x, Length %u) failed\n",
(ULONG)Offset.QuadPart, ChunkSize);
+ DPRINT1("CcPinRead(Offset %x, Length %u) failed\n",
(ULONG)Offset.QuadPart, ChunkSize);
return STATUS_UNSUCCESSFUL;
}
Block = (PULONG)((ULONG_PTR)BaseAddress + (i * 4) % ChunkSize);
@@ -342,7 +342,7 @@
PUSHORT CBlock;
Offset.QuadPart = 0;
- if (!CcMapData(DeviceExt->FATFileObject, &Offset,
DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector, 1, &Context,
&BaseAddress))
+ if (!CcMapData(DeviceExt->FATFileObject, &Offset,
DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector, MAP_WAIT,
&Context, &BaseAddress))
{
return STATUS_UNSUCCESSFUL;
}
@@ -397,7 +397,7 @@
for (i = 2; i < FatLength; )
{
Offset.QuadPart = ROUND_DOWN(i * 2, ChunkSize);
- if (!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, 1,
&Context, &BaseAddress))
+ if (!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, MAP_WAIT,
&Context, &BaseAddress))
{
return STATUS_UNSUCCESSFUL;
}
@@ -447,7 +447,7 @@
for (i = 2; i < FatLength; )
{
Offset.QuadPart = ROUND_DOWN(i * 4, ChunkSize);
- if (!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, 1,
&Context, &BaseAddress))
+ if (!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, MAP_WAIT,
&Context, &BaseAddress))
{
DPRINT1("CcMapData(Offset %x, Length %u) failed\n",
(ULONG)Offset.QuadPart, ChunkSize);
return STATUS_UNSUCCESSFUL;
@@ -513,7 +513,7 @@
LARGE_INTEGER Offset;
Offset.QuadPart = 0;
- if (!CcPinRead(DeviceExt->FATFileObject, &Offset,
DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector, 1, &Context,
&BaseAddress))
+ if (!CcPinRead(DeviceExt->FATFileObject, &Offset,
DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector, PIN_WAIT,
&Context, &BaseAddress))
{
return STATUS_UNSUCCESSFUL;
}
@@ -562,7 +562,7 @@
ChunkSize = CACHEPAGESIZE(DeviceExt);
FATOffset = ClusterToWrite * 2;
Offset.QuadPart = ROUND_DOWN(FATOffset, ChunkSize);
- if (!CcPinRead(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context,
&BaseAddress))
+ if (!CcPinRead(DeviceExt->FATFileObject, &Offset, ChunkSize, PIN_WAIT,
&Context, &BaseAddress))
{
return STATUS_UNSUCCESSFUL;
}
@@ -598,7 +598,7 @@
FATOffset = (ClusterToWrite * 4);
Offset.QuadPart = ROUND_DOWN(FATOffset, ChunkSize);
- if (!CcPinRead(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context,
&BaseAddress))
+ if (!CcPinRead(DeviceExt->FATFileObject, &Offset, ChunkSize, PIN_WAIT,
&Context, &BaseAddress))
{
return STATUS_UNSUCCESSFUL;
}