Windows: buf_CleanAsyncLocked dirty range only
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 15 Nov 2011 23:35:26 +0000 (18:35 -0500)
committerDerrick Brashear <shadow@dementix.org>
Sun, 26 Feb 2012 06:31:55 +0000 (22:31 -0800)
buf_CleanAsyncLocked() should not instruct cm_BufWrite() to
write a full chunk if the current buffer is the only one that
is dirty.  cm_BufWrite() will determine if it is appropriate
to fill a full chunk when storing.  Instructing it to check
a full chunk forces it to do more work than necessary.

Reviewed-on: http://gerrit.openafs.org/6054
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit fd42e08bf1882a02c3200e1c33a101e644aa046a)

Change-Id: Ibbd823feb5fe18f0ab0ee54af8c9b8ccb531c8bc
Reviewed-on: http://gerrit.openafs.org/6808
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/WINNT/afsd/cm_buf.c

index f6587e8..ac64f53 100644 (file)
@@ -783,15 +783,14 @@ afs_uint32 buf_CleanAsyncLocked(cm_scache_t *scp, cm_buf_t *bp, cm_req_t *reqp,
 
             offset = bp->offset;
             LargeIntegerAdd(offset, ConvertLongToLargeInteger(bp->dirty_offset));
+            /*
+             * Only specify the dirty length of the current buffer in the call
+             * to cm_BufWrite().  It is the responsibility of cm_BufWrite()
+             * to determine if it is appropriate to fill a full chunk of data
+             * when storing to the file server.
+             */
             code = (*cm_buf_opsp->Writep)(scp, &offset,
-#if 1
-                                          /* we might as well try to write all of the contiguous
-                                           * dirty buffers in one RPC
-                                           */
-                                          cm_chunkSize,
-#else
                                           bp->dirty_length,
-#endif
                                           flags, bp->userp, reqp);
             osi_Log3(buf_logp, "buf_CleanAsyncLocked I/O on scp 0x%p buf 0x%p, done=%d", scp, bp, code);
         }