]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
memcache-set-default-write-size-20051002
authorDerrick Brashear <shadow@dementia.org>
Mon, 3 Oct 2005 03:54:44 +0000 (03:54 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 3 Oct 2005 03:54:44 +0000 (03:54 +0000)
based on comment from chas williams. set the default write amount as is
done for ufs cache writes

src/afs/VNOPS/afs_vnop_write.c

index ed1ee645feccf33d58b241b93614ad39ac0b54f1..4a7a4b3cdeb04d1131f5be6c950664855e32c417 100644 (file)
@@ -186,12 +186,13 @@ afs_MemWrite(register struct vcache *avc, struct uio *auio, int aio,
     avc->states |= CDirty;
     tvec = (struct iovec *)osi_AllocSmallSpace(sizeof(struct iovec));
     while (totalLength > 0) {
-       /* Read the cached info. If we call GetDCache while the cache
-        * truncate daemon is running we risk overflowing the disk cache.
-        * Instead we check for an existing cache slot. If we cannot
-        * find an existing slot we wait for the cache to drain
-        * before calling GetDCache.
+       /* 
+        *  The following line is necessary because afs_GetDCache with
+        *  flag == 4 expects the length field to be filled. It decides
+        *  from this whether it's necessary to fetch data into the chunk
+        *  before writing or not (when the whole chunk is overwritten!).
         */
+       len = totalLength;      /* write this amount by default */
        if (noLock) {
            tdc = afs_FindDCache(avc, filePos);
            if (tdc)