Filip Navara schrieb:
I tried it and needed the attached changes in order to boot...
Thanks for testing my changes.
[cc02.diff] Don't try to map data past the end of file in VFAT.
I think that this patch isn't necessary, because the real problem is in pin.c.
[cc03.diff] Fix incorrect check in CcMapData.
The check which you have changed was correct. Currently the file size is limited to the number of cache view entries. I will implement a x-level tree structure in the future. But some other checks are incorrect. I've add a patch.
Also I've patch which fixes fast mutex implementation and it's usage, which depends on these cache manager changes.
The global lock (fast mutex) implementation is a little bit dirty. Currently I implement a function which does remove the unneeded data section objects after some time. My problem is the sequence to acquire the segment lock and the global lock.
- Hartmut
E:\Sandbox\ros_cache\reactos>set SVN_EDITOR=notepad
E:\Sandbox\ros_cache\reactos>d:\programme\subversion\bin\svn.exe diff ntoskrnl\cc\pin.c Index: ntoskrnl/cc/pin.c =================================================================== --- ntoskrnl/cc/pin.c (Revision 13570) +++ ntoskrnl/cc/pin.c (Arbeitskopie) @@ -67,20 +67,26 @@
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
- if (FileOffset->QuadPart + Length > Bcb->FileSizes.AllocationSize.QuadPart) + if (FileOffset->QuadPart >= Bcb->FileSizes.FileSize.QuadPart) { - DPRINT("%d %I64d %I64d\n", Length, FileOffset->QuadPart + Length, Bcb->FileSizes.AllocationSize.QuadPart); -// KEBUGCHECK(0); + CHECKPOINT1; + *piBcb = NULL; + *pBuffer = NULL; + return FALSE; }
- if (FileOffset->QuadPart + Length - ROUND_DOWN(FileOffset->QuadPart, CACHE_VIEW_SIZE) > CACHE_VIEW_SIZE) + if (FileOffset->QuadPart + Length > Bcb->FileSizes.FileSize.QuadPart) { - /* not implemented */ + CHECKPOINT1; + Length = Bcb->FileSizes.FileSize.QuadPart - FileOffset->QuadPart; + } + + if (ROUND_DOWN(FileOffset->QuadPart, CACHE_VIEW_SIZE) + CACHE_VIEW_SIZE != ROUND_UP(FileOffset->QuadPart + Length, CACHE_VIEW_SIZE)) + { + /* Mapping over the border of a cache view isn't implemented */ KEBUGCHECK(0); }
- - if (Bcb->FileSizes.AllocationSize.QuadPart > sizeof(Bcb->CacheView) / sizeof(Bcb->CacheView[0]) * CACHE_VIEW_SIZE) { /* not implemented */