Windows: Cc FileObject Settings
authorJeffrey Altman <jaltman@your-file-system.com>
Sun, 29 Apr 2012 14:40:31 +0000 (10:40 -0400)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 29 Apr 2012 19:38:09 +0000 (12:38 -0700)
Modify the assigned CcSetReadAheadGranularity() from 64K to
the afsd_service configured chunk size.

Assign a CcSetDirtyPageThreshold() to be twice the configured chunk size.

Change-Id: I1cfa67612058cf5e08906e369236d0d8a48c54f0
Reviewed-on: http://gerrit.openafs.org/7294
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

src/WINNT/afsrdr/kernel/lib/AFSRead.cpp
src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp
src/WINNT/afsrdr/kernel/lib/Include/AFSDefines.h

index 6810d4d..660e90f 100644 (file)
@@ -1198,7 +1198,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)
                 {
index a9b5225..e4db03a 100644 (file)
@@ -359,8 +359,10 @@ AFSCommonWrite( 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)
                 {
index fc5dc2c..f600fdb 100644 (file)
@@ -206,12 +206,6 @@ NTSTATUS
 //
 #define AFS_SERVER_PURGE_SLEEP  6
 
-//
-// Read ahead granularity
-//
-
-#define READ_AHEAD_GRANULARITY      0x10000     // 64KB
-
 #define AFS_DIR_ENUM_BUFFER_LEN   (16 * 1024)
 
 //
@@ -351,6 +345,8 @@ NTSTATUS
 
 #define AFS_MAXIMUM_EXTENT_RELEASE_COUNT        100
 
+#define AFS_DIRTY_CHUNK_THRESHOLD               2
+
 // {41966169-3FD7-4392-AFE4-E6A9D0A92C72}  - generated using guidgen.exe
 DEFINE_GUID (GUID_SD_AFS_REDIRECTOR_CONTROL_OBJECT,
         0x41966169, 0x3fd7, 0x4392, 0xaf, 0xe4, 0xe6, 0xa9, 0xd0, 0xa9, 0x2c, 0x72);