From: Derrick Brashear Date: Mon, 3 Oct 2005 03:55:33 +0000 (+0000) Subject: STABLE14-memcache-set-default-write-size-20051002 X-Git-Tag: openafs-stable-1_4_0-rc6~4 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=a5d8c8dad1b8f473523d387abaa026911c0bd5c2;p=packages%2Fo%2Fopenafs.git STABLE14-memcache-set-default-write-size-20051002 based on comment from chas williams. set the default write amount as is done for ufs cache writes (cherry picked from commit 543e49eaaea2290c4239dd79864384f11adb2607) --- diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c index 4a93e5572..8b18d5756 100644 --- a/src/afs/VNOPS/afs_vnop_write.c +++ b/src/afs/VNOPS/afs_vnop_write.c @@ -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)