Author: pschweitzer
Date: Sun Oct 26 20:20:42 2014
New Revision: 65031
URL:
http://svn.reactos.org/svn/reactos?rev=65031&view=rev
Log:
[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 :-).
Modified:
trunk/reactos/drivers/filesystems/fastfat/create.c
trunk/reactos/drivers/filesystems/fastfat/fcb.c
trunk/reactos/drivers/filesystems/fastfat/finfo.c
Modified: trunk/reactos/drivers/filesystems/fastfat/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] Sun Oct 26 20:20:42
2014
@@ -365,7 +365,7 @@
DPRINT("'%wZ'\n",
&FileObject->RelatedFileObject->FileName);
*ParentFcb = FileObject->RelatedFileObject->FsContext;
- (*ParentFcb)->RefCount++;
+ vfatGrabFCB(DeviceExt, *ParentFcb);
}
else
{
@@ -391,7 +391,7 @@
if (*ParentFcb)
{
- (*ParentFcb)->RefCount++;
+ vfatGrabFCB(DeviceExt, *ParentFcb);
}
/* try first to find an existing FCB in memory */
@@ -497,7 +497,7 @@
pFcb = DeviceExt->VolumeFcb;
vfatAttachFCBToFileObject(DeviceExt, pFcb, FileObject);
- pFcb->RefCount++;
+ vfatGrabFCB(DeviceExt, pFcb);
Irp->IoStatus.Information = FILE_OPENED;
return STATUS_SUCCESS;
@@ -562,7 +562,7 @@
if (Status == STATUS_SUCCESS)
{
- ParentFcb->RefCount++;
+ vfatGrabFCB(DeviceExt, ParentFcb);
vfatReleaseFCB(DeviceExt, TargetFcb);
Irp->IoStatus.Information = FILE_EXISTS;
}
Modified: trunk/reactos/drivers/filesystems/fastfat/fcb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] Sun Oct 26 20:20:42 2014
@@ -288,6 +288,14 @@
}
VOID
+vfatGrabFCB(
+ PDEVICE_EXTENSION pVCB,
+ PVFATFCB pFCB)
+{
+ ++pFCB->RefCount;
+}
+
+VOID
vfatReleaseFCB(
PDEVICE_EXTENSION pVCB,
PVFATFCB pFCB)
@@ -338,7 +346,7 @@
}
if (pFCB->parentFcb)
{
- pFCB->parentFcb->RefCount++;
+ vfatGrabFCB(pVCB, pFCB->parentFcb);
}
}
@@ -402,12 +410,6 @@
* We also derefence in case we're just renaming since AddFCBToTable references
it
*/
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;
}
@@ -455,7 +457,7 @@
DPRINT("'%wZ' '%wZ'\n", &FileNameU,
FcbNameU);
if (RtlEqualUnicodeString(&FileNameU, FcbNameU, TRUE))
{
- rcFCB->RefCount++;
+ vfatGrabFCB(pVCB, rcFCB);
return rcFCB;
}
}
@@ -489,7 +491,7 @@
fileObject->FsContext = fcb;
fileObject->FsContext2 = newCCB;
fcb->FileObject = fileObject;
- fcb->RefCount++;
+ vfatGrabFCB(vcb, fcb);
_SEH2_TRY
{
@@ -655,7 +657,7 @@
rcFCB->RFCB.FileSize.QuadPart = Size;
rcFCB->RFCB.ValidDataLength.QuadPart = Size;
rcFCB->RFCB.AllocationSize.QuadPart = ROUND_UP(Size,
vcb->FatInfo.BytesPerCluster);
- rcFCB->RefCount++;
+ vfatGrabFCB(vcb, rcFCB);
if (vfatFCBIsDirectory(rcFCB))
{
vfatFCBInitializeCacheFromVolume(vcb, rcFCB);
@@ -817,7 +819,7 @@
{
*pFCB = FCB;
*pParentFCB = FCB->parentFcb;
- (*pParentFCB)->RefCount++;
+ vfatGrabFCB(pVCB, *pParentFCB);
return STATUS_SUCCESS;
}
Modified: trunk/reactos/drivers/filesystems/fastfat/finfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] Sun Oct 26 20:20:42
2014
@@ -426,7 +426,7 @@
/* Effectively delete old file to allow renaming */
VfatDelEntry(DeviceExt, TargetFcb, NULL);
- (*ParentFCB)->RefCount++;
+ vfatGrabFCB(DeviceExt, *ParentFCB);
vfatReleaseFCB(DeviceExt, TargetFcb);
*Deleted = TRUE;
}
@@ -720,7 +720,7 @@
{
/* Try to find target */
ParentFCB = FCB->parentFcb;
- ParentFCB->RefCount++;
+ vfatGrabFCB(DeviceObject, ParentFCB);
Status = vfatPrepareTargetForRename(DeviceObject,
&ParentFCB,
&NewFile,