Windows: correct typos or mistaken comments
[openafs.git] / src / WINNT / afsrdr / kernel / lib / AFSRead.cpp
index 2ef0f7c..54a1705 100644 (file)
@@ -195,6 +195,7 @@ AFSNonCachedRead( IN PDEVICE_OBJECT DeviceObject,
     IO_STACK_LOCATION *pIrpSp = IoGetCurrentIrpStackLocation( Irp);
     PFILE_OBJECT       pFileObject = pIrpSp->FileObject;
     AFSFcb            *pFcb = (AFSFcb *)pFileObject->FsContext;
+    AFSCcb            *pCcb = (AFSCcb *)pFileObject->FsContext2;
     BOOLEAN            bSynchronousIo = IoIsOperationSynchronous(Irp);
     VOID              *pSystemBuffer = NULL;
     BOOLEAN            bPagingIo = BooleanFlagOn( Irp->Flags, IRP_PAGING_IO);
@@ -285,6 +286,7 @@ AFSNonCachedRead( IN PDEVICE_OBJECT DeviceObject,
                       ulReadByteCount);
 
         ntStatus = AFSRequestExtentsAsync( pFcb,
+                                           pCcb,
                                            &StartingByte,
                                            ulReadByteCount);
 
@@ -357,6 +359,7 @@ AFSNonCachedRead( IN PDEVICE_OBJECT DeviceObject,
                               ulReadByteCount);
 
                 ntStatus = AFSRequestExtentsAsync( pFcb,
+                                                   pCcb,
                                                    &StartingByte,
                                                    ulReadByteCount);
 
@@ -385,7 +388,7 @@ AFSNonCachedRead( IN PDEVICE_OBJECT DeviceObject,
                           StartingByte.QuadPart,
                           ulReadByteCount);
 
-            ntStatus =  AFSWaitForExtentMapping ( pFcb );
+            ntStatus =  AFSWaitForExtentMapping ( pFcb, pCcb);
 
             if (!NT_SUCCESS(ntStatus))
             {
@@ -700,7 +703,8 @@ AFSNonCachedRead( IN PDEVICE_OBJECT DeviceObject,
         // The data is there now.  Give back the extents now so the service
         // has some in hand
         //
-        (VOID) AFSReleaseExtentsWithFlush( pFcb);
+        (VOID) AFSReleaseExtentsWithFlush( pFcb,
+                                           &pCcb->AuthGroup);
 
 try_exit:
 
@@ -781,10 +785,12 @@ AFSRead( IN PDEVICE_OBJECT LibDeviceObject,
 
         ntStatus = AFSCommonRead( AFSRDRDeviceObject, Irp, NULL);
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         ntStatus = STATUS_INSUFFICIENT_RESOURCES;
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -1138,8 +1144,6 @@ AFSCommonRead( IN PDEVICE_OBJECT DeviceObject,
             }
 
             pFcb->Specific.File.ExtentThreadId = (ULONGLONG)PsGetCurrentThreadId();
-
-            pFcb->NPFcb->Specific.File.ExtentsRequestStatus = STATUS_SUCCESS;
         }
 #endif
 
@@ -1151,7 +1155,7 @@ AFSCommonRead( IN PDEVICE_OBJECT DeviceObject,
         if( !bPagingIo && !bNonCachedIo)
         {
 
-            ntStatus = AFSRequestExtentsAsync( pFcb, &liStartingByte, ulByteCount);
+            ntStatus = AFSRequestExtentsAsync( pFcb, pCcb, &liStartingByte, ulByteCount);
 
             if (!NT_SUCCESS(ntStatus))
             {
@@ -1196,7 +1200,10 @@ AFSCommonRead( IN PDEVICE_OBJECT DeviceObject,
                                           pFcb);
 
                     CcSetReadAheadGranularity( pFileObject,
-                                               READ_AHEAD_GRANULARITY);
+                                               pDeviceExt->Specific.RDR.MaximumRPCLength);
+
+                    CcSetDirtyPageThreshold( pFileObject,
+                                             AFS_DIRTY_CHUNK_THRESHOLD * pDeviceExt->Specific.RDR.MaximumRPCLength);
                 }
                 __except( EXCEPTION_EXECUTE_HANDLER)
                 {
@@ -1241,7 +1248,7 @@ AFSCommonRead( IN PDEVICE_OBJECT DeviceObject,
 
                     AFSDbgLogMsg( AFS_SUBSYSTEM_IO_PROCESSING,
                                   AFS_TRACE_LEVEL_ERROR,
-                                  "AFSCachedWrite (%08lX) Exception thrown during mdl read Status %08lX\n",
+                                  "AFSCommonRead (%08lX) Exception thrown during mdl read Status %08lX\n",
                                   Irp,
                                   ntStatus);
                 }
@@ -1316,7 +1323,8 @@ AFSCommonRead( IN PDEVICE_OBJECT DeviceObject,
             pFcb->Specific.File.ExtentLength > 1500)
         {
 
-            AFSQueueFlushExtents( pFcb);
+            AFSQueueFlushExtents( pFcb,
+                                  &pCcb->AuthGroup);
         }
 #endif
 
@@ -1450,7 +1458,7 @@ AFSIOCtlRead( IN PDEVICE_OBJECT DeviceObject,
 
         ntStatus = AFSProcessRequest( AFS_REQUEST_TYPE_PIOCTL_READ,
                                       AFS_REQUEST_FLAG_SYNCHRONOUS,
-                                      &pFcb->AuthGroup,
+                                      &pCcb->AuthGroup,
                                       NULL,
                                       &stParentFID,
                                       (void *)&stIORequestCB,
@@ -1564,7 +1572,7 @@ AFSShareRead( IN PDEVICE_OBJECT DeviceObject,
 
         ntStatus = AFSProcessRequest( AFS_REQUEST_TYPE_PIPE_READ,
                                       AFS_REQUEST_FLAG_SYNCHRONOUS,
-                                      &pFcb->AuthGroup,
+                                      &pCcb->AuthGroup,
                                       &pCcb->DirectoryCB->NameInformation.FileName,
                                       NULL,
                                       (void *)&stIoRequest,