mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
Changed the cache access from vfat...Region() to Cc...Data().
svn path=/trunk/; revision=2285
This commit is contained in:
parent
a23989370d
commit
069a01eede
1 changed files with 21 additions and 53 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: direntry.c,v 1.4 2001/08/01 15:59:24 hbirr Exp $
|
||||
/* $Id: direntry.c,v 1.5 2001/10/10 22:14:34 hbirr Exp $
|
||||
*
|
||||
*
|
||||
* FILE: DirEntry.c
|
||||
|
@ -83,14 +83,14 @@ vfatGetNextDirEntry (PDEVICE_EXTENSION pDeviceExt,
|
|||
PWSTR pLongFileName,
|
||||
PFAT_DIR_ENTRY pDirEntry)
|
||||
{
|
||||
NTSTATUS status;
|
||||
ULONG indexInPage = *pDirectoryIndex % ENTRIES_PER_CACHEPAGE(pDeviceExt);
|
||||
ULONG pageNumber = *pDirectoryIndex / ENTRIES_PER_CACHEPAGE(pDeviceExt);
|
||||
PVOID currentPage = NULL;
|
||||
PCACHE_SEGMENT cacheSegment = NULL;
|
||||
FATDirEntry * fatDirEntry;
|
||||
slot * longNameEntry;
|
||||
ULONG cpos;
|
||||
LARGE_INTEGER FileOffset;
|
||||
PVOID Context;
|
||||
|
||||
DPRINT ("vfatGetNextDirEntry (%x,%x,%d,%x,%x)\n",
|
||||
pDeviceExt,
|
||||
|
@ -101,16 +101,11 @@ vfatGetNextDirEntry (PDEVICE_EXTENSION pDeviceExt,
|
|||
|
||||
*pLongFileName = 0;
|
||||
|
||||
DPRINT ("Validating current directory page\n");
|
||||
status = vfatRequestAndValidateRegion (pDeviceExt,
|
||||
pDirectoryFCB,
|
||||
pageNumber * CACHEPAGESIZE(pDeviceExt),
|
||||
(PVOID *) ¤tPage,
|
||||
&cacheSegment,
|
||||
FALSE);
|
||||
if (!NT_SUCCESS (status))
|
||||
FileOffset.QuadPart = pageNumber * CACHEPAGESIZE(pDeviceExt);
|
||||
if (!CcMapData(pDirectoryFCB->FileObject, &FileOffset,
|
||||
CACHEPAGESIZE(pDeviceExt), TRUE, &Context, ¤tPage))
|
||||
{
|
||||
return status;
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
while (TRUE)
|
||||
|
@ -120,9 +115,7 @@ vfatGetNextDirEntry (PDEVICE_EXTENSION pDeviceExt,
|
|||
if (vfatIsDirEntryEndMarker (&fatDirEntry [indexInPage]))
|
||||
{
|
||||
DPRINT ("end of directory, returning no more entries\n");
|
||||
status = vfatReleaseRegion (pDeviceExt,
|
||||
pDirectoryFCB,
|
||||
cacheSegment);
|
||||
CcUnpinData(Context);
|
||||
return STATUS_NO_MORE_ENTRIES;
|
||||
}
|
||||
else if (vfatIsDirEntryLongName (&fatDirEntry [indexInPage])
|
||||
|
@ -155,22 +148,12 @@ vfatGetNextDirEntry (PDEVICE_EXTENSION pDeviceExt,
|
|||
indexInPage = 0;
|
||||
pageNumber++;
|
||||
|
||||
status = vfatReleaseRegion (pDeviceExt,
|
||||
pDirectoryFCB,
|
||||
cacheSegment);
|
||||
if (!NT_SUCCESS (status))
|
||||
CcUnpinData(Context);
|
||||
FileOffset.QuadPart = pageNumber * CACHEPAGESIZE(pDeviceExt);
|
||||
if (!CcMapData(pDirectoryFCB->FileObject, &FileOffset,
|
||||
CACHEPAGESIZE(pDeviceExt), TRUE, &Context, ¤tPage))
|
||||
{
|
||||
return status;
|
||||
}
|
||||
status = vfatRequestAndValidateRegion (pDeviceExt,
|
||||
pDirectoryFCB,
|
||||
pageNumber * CACHEPAGESIZE(pDeviceExt),
|
||||
(PVOID *) ¤tPage,
|
||||
&cacheSegment,
|
||||
FALSE);
|
||||
if (!NT_SUCCESS (status))
|
||||
{
|
||||
return status;
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
longNameEntry = (slot *) currentPage;
|
||||
}
|
||||
|
@ -197,22 +180,12 @@ vfatGetNextDirEntry (PDEVICE_EXTENSION pDeviceExt,
|
|||
indexInPage = 0;
|
||||
pageNumber++;
|
||||
|
||||
status = vfatReleaseRegion (pDeviceExt,
|
||||
pDirectoryFCB,
|
||||
cacheSegment);
|
||||
if (!NT_SUCCESS (status))
|
||||
{
|
||||
return status;
|
||||
}
|
||||
status = vfatRequestAndValidateRegion (pDeviceExt,
|
||||
pDirectoryFCB,
|
||||
pageNumber * CACHEPAGESIZE(pDeviceExt),
|
||||
(PVOID *) ¤tPage,
|
||||
&cacheSegment,
|
||||
FALSE);
|
||||
if (!NT_SUCCESS (status))
|
||||
{
|
||||
return status;
|
||||
CcUnpinData(Context);
|
||||
FileOffset.QuadPart = pageNumber * CACHEPAGESIZE(pDeviceExt);
|
||||
if (!CcMapData(pDirectoryFCB->FileObject, &FileOffset,
|
||||
CACHEPAGESIZE(pDeviceExt), TRUE, &Context, ¤tPage))
|
||||
{
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -223,13 +196,8 @@ vfatGetNextDirEntry (PDEVICE_EXTENSION pDeviceExt,
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DPRINT ("Releasing current directory page\n");
|
||||
status = vfatReleaseRegion (pDeviceExt,
|
||||
pDirectoryFCB,
|
||||
cacheSegment);
|
||||
|
||||
return status;
|
||||
CcUnpinData(Context);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue