[NTOSKRNL]
[reactos.git] / ntoskrnl / cc / cacheman.c
index 3eefc92..4d62314 100644 (file)
@@ -13,6 +13,7 @@
 #define NDEBUG
 #include <debug.h>
 
+BOOLEAN CcPfEnablePrefetcher;
 PFSN_PREFETCHER_GLOBALS CcPfGlobals;
 
 /* FUNCTIONS *****************************************************************/
@@ -117,10 +118,18 @@ CcSetBcbOwnerPointer (
        IN      PVOID   Owner
        )
 {
+    PINTERNAL_BCB iBcb = Bcb;
+
     CCTRACE(CC_API_DEBUG, "Bcb=%p Owner=%p\n",
         Bcb, Owner);
 
-       UNIMPLEMENTED;
+    if (!ExIsResourceAcquiredExclusiveLite(&iBcb->Lock) && !ExIsResourceAcquiredSharedLite(&iBcb->Lock))
+    {
+        DPRINT1("Current thread doesn't own resource!\n");
+        return;
+    }
+
+    ExSetResourceOwnerPointer(&iBcb->Lock, Owner);
 }
 
 /*
@@ -149,8 +158,10 @@ CcSetReadAheadGranularity (
        IN      ULONG           Granularity
        )
 {
+    static ULONG Warn;
+
     CCTRACE(CC_API_DEBUG, "FileObject=%p Granularity=%lu\n",
         FileObject, Granularity);
 
-       UNIMPLEMENTED;
+    if (!Warn++) UNIMPLEMENTED;
 }