Author: cwittich
Date: Sun Jan 13 14:36:54 2008
New Revision: 31753
URL:
http://svn.reactos.org/svn/reactos?rev=31753&view=rev
Log:
-use ExAllocatePoolWithTag instead of ExAllocatePool
-add missing critical region acquiring to the NtfsCreate routine.
Modified:
trunk/reactos/drivers/filesystems/ntfs/create.c
trunk/reactos/drivers/filesystems/ntfs/dirctl.c
trunk/reactos/drivers/filesystems/ntfs/fsctl.c
trunk/reactos/drivers/filesystems/ntfs/mft.c
trunk/reactos/drivers/filesystems/ntfs/ntfs.h
Modified: trunk/reactos/drivers/filesystems/ntfs/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/create.c (original)
+++ trunk/reactos/drivers/filesystems/ntfs/create.c Sun Jan 13 14:36:54 2008
@@ -60,7 +60,7 @@
/* construct absolute path name */
ASSERT(wcslen (Fcb->PathName) + 1 + wcslen (pRelativeFileName) + 1
<= MAX_PATH);
- rcName = ExAllocatePool(NonPagedPool, MAX_PATH * sizeof(WCHAR));
+ rcName = ExAllocatePoolWithTag(NonPagedPool, MAX_PATH * sizeof(WCHAR), TAG_NTFS);
if (!rcName)
{
return(STATUS_INSUFFICIENT_RESOURCES);
@@ -223,11 +223,13 @@
DeviceExt = DeviceObject->DeviceExtension;
+ FsRtlEnterFileSystem();
ExAcquireResourceExclusiveLite(&DeviceExt->DirResource,
TRUE);
Status = NtfsCreateFile(DeviceObject,
Irp);
ExReleaseResourceLite(&DeviceExt->DirResource);
+ FsRtlExitFileSystem();
ByeBye:
Irp->IoStatus.Status = Status;
Modified: trunk/reactos/drivers/filesystems/ntfs/dirctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/dirctl.c (original)
+++ trunk/reactos/drivers/filesystems/ntfs/dirctl.c Sun Jan 13 14:36:54 2008
@@ -521,7 +521,7 @@
{
First = TRUE;
Ccb->DirectorySearchPattern =
- ExAllocatePool(NonPagedPool, SearchPattern->Length + sizeof(WCHAR));
+ ExAllocatePoolWithTag(NonPagedPool, SearchPattern->Length + sizeof(WCHAR),
TAG_NTFS);
if (!Ccb->DirectorySearchPattern)
{
return(STATUS_INSUFFICIENT_RESOURCES);
@@ -536,7 +536,7 @@
else if (!Ccb->DirectorySearchPattern)
{
First = TRUE;
- Ccb->DirectorySearchPattern = ExAllocatePool(NonPagedPool, 2 * sizeof(WCHAR));
+ Ccb->DirectorySearchPattern = ExAllocatePoolWithTag(NonPagedPool, 2 *
sizeof(WCHAR), TAG_NTFS);
if (!Ccb->DirectorySearchPattern)
{
return(STATUS_INSUFFICIENT_RESOURCES);
Modified: trunk/reactos/drivers/filesystems/ntfs/fsctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/fsctl.c (original)
+++ trunk/reactos/drivers/filesystems/ntfs/fsctl.c Sun Jan 13 14:36:54 2008
@@ -91,8 +91,8 @@
}
DPRINT1("BytesPerSector: %lu\n", DiskGeometry.BytesPerSector);
- BootSector = ExAllocatePool(NonPagedPool,
- DiskGeometry.BytesPerSector);
+ BootSector = ExAllocatePoolWithTag(NonPagedPool,
+ DiskGeometry.BytesPerSector, TAG_NTFS);
if (BootSector == NULL)
{
return(STATUS_INSUFFICIENT_RESOURCES);
@@ -150,8 +150,8 @@
}
DPRINT("BytesPerSector: %lu\n", DiskGeometry.BytesPerSector);
- BootSector = ExAllocatePool(NonPagedPool,
- DiskGeometry.BytesPerSector);
+ BootSector = ExAllocatePoolWithTag(NonPagedPool,
+ DiskGeometry.BytesPerSector, TAG_NTFS);
if (BootSector == NULL)
{
return(STATUS_INSUFFICIENT_RESOURCES);
@@ -201,8 +201,8 @@
ExFreePool(BootSector);
- MftRecord = ExAllocatePool(NonPagedPool,
- NtfsInfo->BytesPerFileRecord);
+ MftRecord = ExAllocatePoolWithTag(NonPagedPool,
+ NtfsInfo->BytesPerFileRecord, TAG_NTFS);
if (MftRecord == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
@@ -220,7 +220,7 @@
return Status;
}
- VolumeRecord = ExAllocatePool(NonPagedPool, NtfsInfo->BytesPerFileRecord);
+ VolumeRecord = ExAllocatePoolWithTag(NonPagedPool, NtfsInfo->BytesPerFileRecord,
TAG_NTFS);
if (VolumeRecord == NULL)
{
ExFreePool (MftRecord);
Modified: trunk/reactos/drivers/filesystems/ntfs/mft.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/m…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/mft.c (original)
+++ trunk/reactos/drivers/filesystems/ntfs/mft.c Sun Jan 13 14:36:54 2008
@@ -58,8 +58,8 @@
BytesPerFileRecord = Vcb->NtfsInfo.BytesPerFileRecord;
- MftRecord = ExAllocatePool(NonPagedPool,
- BytesPerFileRecord);
+ MftRecord = ExAllocatePoolWithTag(NonPagedPool,
+ BytesPerFileRecord, TAG_NTFS);
if (MftRecord == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
@@ -86,7 +86,7 @@
n = AttributeDataLength (FindAttribute (MftRecord, AttributeData, 0))
/ BytesPerFileRecord;
- FileRecord = ExAllocatePool(NonPagedPool, BytesPerFileRecord);
+ FileRecord = ExAllocatePoolWithTag(NonPagedPool, BytesPerFileRecord, TAG_NTFS);
if (FileRecord == NULL)
{
ExFreePool(MftRecord);
@@ -198,7 +198,7 @@
LONG m = (Vcb->NtfsInfo.BytesPerCluster / BytesPerFileRecord) - 1;
ULONG n = m > 0 ? (index & m) : 0;
- p = ExAllocatePool(NonPagedPool, clusters * Vcb->NtfsInfo.BytesPerCluster);
+ p = ExAllocatePoolWithTag(NonPagedPool, clusters * Vcb->NtfsInfo.BytesPerCluster,
TAG_NTFS);
ReadVCN (Vcb, Mft, AttributeData, vcn, clusters, p);
Modified: trunk/reactos/drivers/filesystems/ntfs/ntfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/n…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/ntfs.h (original)
+++ trunk/reactos/drivers/filesystems/ntfs/ntfs.h Sun Jan 13 14:36:54 2008
@@ -15,6 +15,8 @@
#ifndef TAG
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) +
((D)<<24))
#endif
+
+#define TAG_NTFS TAG('N', 'T', 'F', 'S')
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))