From 841ace6796ab03c5e7c3b3d1241615dc12224c1e Mon Sep 17 00:00:00 2001 From: Vizzini Date: Sun, 20 Jun 2004 02:10:07 +0000 Subject: [PATCH] backed out bugified patch svn path=/trunk/; revision=9736 --- reactos/ntoskrnl/cc/copy.c | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/reactos/ntoskrnl/cc/copy.c b/reactos/ntoskrnl/cc/copy.c index e501682fd25..e8d7e581993 100644 --- a/reactos/ntoskrnl/cc/copy.c +++ b/reactos/ntoskrnl/cc/copy.c @@ -1,4 +1,4 @@ -/* $Id: copy.c,v 1.25 2004/06/19 08:53:35 vizzini Exp $ +/* $Id: copy.c,v 1.26 2004/06/20 02:10:07 vizzini Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -139,12 +139,7 @@ ReadCacheSegmentChain(PBCB Bcb, ULONG ReadOffset, ULONG Length, /* * Create an MDL which contains all their pages. */ - Mdl = MmCreateMdl(NULL, NULL, current_size); - if(Mdl == NULL) { - DPRINT("MmCreateMdl: Out of memory!"); - return(STATUS_NO_MEMORY); - } - + MmInitializeMdl(Mdl, NULL, current_size); Mdl->MdlFlags |= (MDL_PAGES_LOCKED | MDL_IO_PAGE_READ); current2 = current; offset = 0; @@ -227,14 +222,8 @@ ReadCacheSegment(PCACHE_SEGMENT CacheSeg) { Size = CacheSeg->Bcb->CacheSegmentSize; } - - Mdl = MmCreateMdl(NULL, CacheSeg->BaseAddress, Size); - if(Mdl == NULL) - { - DPRINT("MmCreateMdl: Out of memory!"); - return(STATUS_NO_MEMORY); - } - + Mdl = alloca(MmSizeOfMdl(CacheSeg->BaseAddress, Size)); + MmInitializeMdl(Mdl, CacheSeg->BaseAddress, Size); MmBuildMdlForNonPagedPool(Mdl); Mdl->MdlFlags |= MDL_IO_PAGE_READ; KeInitializeEvent(&Event, NotificationEvent, FALSE); @@ -275,14 +264,8 @@ WriteCacheSegment(PCACHE_SEGMENT CacheSeg) { Size = CacheSeg->Bcb->CacheSegmentSize; } - - Mdl = MmCreateMdl(NULL, CacheSeg->BaseAddress, Size); - if(Mdl == NULL) - { - DPRINT("MmCreateMdl: Out of memory!"); - return(STATUS_NO_MEMORY); - } - + Mdl = alloca(MmSizeOfMdl(CacheSeg->BaseAddress, Size)); + MmInitializeMdl(Mdl, CacheSeg->BaseAddress, Size); MmBuildMdlForNonPagedPool(Mdl); Mdl->MdlFlags |= MDL_IO_PAGE_READ; KeInitializeEvent(&Event, NotificationEvent, FALSE);