mirror of
https://github.com/reactos/reactos.git
synced 2025-05-13 14:20:31 +00:00
[FASTFAT]
Implement vfatGrabFCB() (which was defined but never implemented) for increasing the reference count on a FCB. This will make debugging easier. Dedicated to Thomas :-). svn path=/trunk/; revision=65031
This commit is contained in:
parent
531323417d
commit
c9e616ea2b
3 changed files with 19 additions and 17 deletions
|
@ -365,7 +365,7 @@ VfatOpenFile(
|
||||||
DPRINT("'%wZ'\n", &FileObject->RelatedFileObject->FileName);
|
DPRINT("'%wZ'\n", &FileObject->RelatedFileObject->FileName);
|
||||||
|
|
||||||
*ParentFcb = FileObject->RelatedFileObject->FsContext;
|
*ParentFcb = FileObject->RelatedFileObject->FsContext;
|
||||||
(*ParentFcb)->RefCount++;
|
vfatGrabFCB(DeviceExt, *ParentFcb);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -391,7 +391,7 @@ VfatOpenFile(
|
||||||
|
|
||||||
if (*ParentFcb)
|
if (*ParentFcb)
|
||||||
{
|
{
|
||||||
(*ParentFcb)->RefCount++;
|
vfatGrabFCB(DeviceExt, *ParentFcb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* try first to find an existing FCB in memory */
|
/* try first to find an existing FCB in memory */
|
||||||
|
@ -497,7 +497,7 @@ VfatCreateFile(
|
||||||
|
|
||||||
pFcb = DeviceExt->VolumeFcb;
|
pFcb = DeviceExt->VolumeFcb;
|
||||||
vfatAttachFCBToFileObject(DeviceExt, pFcb, FileObject);
|
vfatAttachFCBToFileObject(DeviceExt, pFcb, FileObject);
|
||||||
pFcb->RefCount++;
|
vfatGrabFCB(DeviceExt, pFcb);
|
||||||
|
|
||||||
Irp->IoStatus.Information = FILE_OPENED;
|
Irp->IoStatus.Information = FILE_OPENED;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
@ -562,7 +562,7 @@ VfatCreateFile(
|
||||||
|
|
||||||
if (Status == STATUS_SUCCESS)
|
if (Status == STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
ParentFcb->RefCount++;
|
vfatGrabFCB(DeviceExt, ParentFcb);
|
||||||
vfatReleaseFCB(DeviceExt, TargetFcb);
|
vfatReleaseFCB(DeviceExt, TargetFcb);
|
||||||
Irp->IoStatus.Information = FILE_EXISTS;
|
Irp->IoStatus.Information = FILE_EXISTS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -287,6 +287,14 @@ vfatFCBIsRoot(
|
||||||
return FCB->PathNameU.Length == sizeof(WCHAR) && FCB->PathNameU.Buffer[0] == L'\\' ? TRUE : FALSE;
|
return FCB->PathNameU.Length == sizeof(WCHAR) && FCB->PathNameU.Buffer[0] == L'\\' ? TRUE : FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
vfatGrabFCB(
|
||||||
|
PDEVICE_EXTENSION pVCB,
|
||||||
|
PVFATFCB pFCB)
|
||||||
|
{
|
||||||
|
++pFCB->RefCount;
|
||||||
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
vfatReleaseFCB(
|
vfatReleaseFCB(
|
||||||
PDEVICE_EXTENSION pVCB,
|
PDEVICE_EXTENSION pVCB,
|
||||||
|
@ -338,7 +346,7 @@ vfatAddFCBToTable(
|
||||||
}
|
}
|
||||||
if (pFCB->parentFcb)
|
if (pFCB->parentFcb)
|
||||||
{
|
{
|
||||||
pFCB->parentFcb->RefCount++;
|
vfatGrabFCB(pVCB, pFCB->parentFcb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,12 +411,6 @@ vfatUpdateFCB(
|
||||||
*/
|
*/
|
||||||
vfatReleaseFCB(pVCB, OldParent);
|
vfatReleaseFCB(pVCB, OldParent);
|
||||||
|
|
||||||
/* In case we were moving accross directories, reset caching on old parent */
|
|
||||||
//if (OldParent != ParentFcb)
|
|
||||||
//{
|
|
||||||
// CcUninitializeCacheMap(OldParent->FileObject, NULL, NULL);
|
|
||||||
//}
|
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,7 +457,7 @@ vfatGrabFCBFromTable(
|
||||||
DPRINT("'%wZ' '%wZ'\n", &FileNameU, FcbNameU);
|
DPRINT("'%wZ' '%wZ'\n", &FileNameU, FcbNameU);
|
||||||
if (RtlEqualUnicodeString(&FileNameU, FcbNameU, TRUE))
|
if (RtlEqualUnicodeString(&FileNameU, FcbNameU, TRUE))
|
||||||
{
|
{
|
||||||
rcFCB->RefCount++;
|
vfatGrabFCB(pVCB, rcFCB);
|
||||||
return rcFCB;
|
return rcFCB;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -489,7 +491,7 @@ vfatFCBInitializeCacheFromVolume(
|
||||||
fileObject->FsContext = fcb;
|
fileObject->FsContext = fcb;
|
||||||
fileObject->FsContext2 = newCCB;
|
fileObject->FsContext2 = newCCB;
|
||||||
fcb->FileObject = fileObject;
|
fcb->FileObject = fileObject;
|
||||||
fcb->RefCount++;
|
vfatGrabFCB(vcb, fcb);
|
||||||
|
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
|
@ -655,7 +657,7 @@ vfatMakeFCBFromDirEntry(
|
||||||
rcFCB->RFCB.FileSize.QuadPart = Size;
|
rcFCB->RFCB.FileSize.QuadPart = Size;
|
||||||
rcFCB->RFCB.ValidDataLength.QuadPart = Size;
|
rcFCB->RFCB.ValidDataLength.QuadPart = Size;
|
||||||
rcFCB->RFCB.AllocationSize.QuadPart = ROUND_UP(Size, vcb->FatInfo.BytesPerCluster);
|
rcFCB->RFCB.AllocationSize.QuadPart = ROUND_UP(Size, vcb->FatInfo.BytesPerCluster);
|
||||||
rcFCB->RefCount++;
|
vfatGrabFCB(vcb, rcFCB);
|
||||||
if (vfatFCBIsDirectory(rcFCB))
|
if (vfatFCBIsDirectory(rcFCB))
|
||||||
{
|
{
|
||||||
vfatFCBInitializeCacheFromVolume(vcb, rcFCB);
|
vfatFCBInitializeCacheFromVolume(vcb, rcFCB);
|
||||||
|
@ -817,7 +819,7 @@ vfatGetFCBForFile(
|
||||||
{
|
{
|
||||||
*pFCB = FCB;
|
*pFCB = FCB;
|
||||||
*pParentFCB = FCB->parentFcb;
|
*pParentFCB = FCB->parentFcb;
|
||||||
(*pParentFCB)->RefCount++;
|
vfatGrabFCB(pVCB, *pParentFCB);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -426,7 +426,7 @@ vfatPrepareTargetForRename(
|
||||||
|
|
||||||
/* Effectively delete old file to allow renaming */
|
/* Effectively delete old file to allow renaming */
|
||||||
VfatDelEntry(DeviceExt, TargetFcb, NULL);
|
VfatDelEntry(DeviceExt, TargetFcb, NULL);
|
||||||
(*ParentFCB)->RefCount++;
|
vfatGrabFCB(DeviceExt, *ParentFCB);
|
||||||
vfatReleaseFCB(DeviceExt, TargetFcb);
|
vfatReleaseFCB(DeviceExt, TargetFcb);
|
||||||
*Deleted = TRUE;
|
*Deleted = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -720,7 +720,7 @@ VfatSetRenameInformation(
|
||||||
{
|
{
|
||||||
/* Try to find target */
|
/* Try to find target */
|
||||||
ParentFCB = FCB->parentFcb;
|
ParentFCB = FCB->parentFcb;
|
||||||
ParentFCB->RefCount++;
|
vfatGrabFCB(DeviceObject, ParentFCB);
|
||||||
Status = vfatPrepareTargetForRename(DeviceObject,
|
Status = vfatPrepareTargetForRename(DeviceObject,
|
||||||
&ParentFCB,
|
&ParentFCB,
|
||||||
&NewFile,
|
&NewFile,
|
||||||
|
|
Loading…
Reference in a new issue