Use the padd op.
authorFelix Frank <Felix.Frank@Desy.de>
Sun, 20 Sep 2009 12:43:34 +0000 (14:43 +0200)
committerDerrick Brashear <shadow|account-1000005@unknown>
Mon, 21 Sep 2009 16:30:28 +0000 (09:30 -0700)
When the padd operation was added, the change that makes actual use
of it got lost somewhere along the line. Fixed now.

Originally introduction of the padd op:
6220ede6a96d06c53eddd848435764cff96be1b4

Reviewed-on: http://gerrit.openafs.org/471
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/afs/afs_fetchstore.c

index 6f2f354..51ee43a 100644 (file)
@@ -494,24 +494,7 @@ afs_CacheStoreDCaches(struct vcache *avc, struct dcache **dclist,
        afs_CFileClose(tfile);
        if ((tdc->f.chunkBytes < afs_OtherCSize)
                && (i < (nchunks - 1)) && code == 0) {
-           int bsent, tlen, sbytes = afs_OtherCSize - tdc->f.chunkBytes;
-           char *tbuffer = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
-
-           while (sbytes > 0) {
-               tlen = (sbytes > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : sbytes);
-               memset(tbuffer, 0, tlen);
-               RX_AFS_GUNLOCK();
-               bsent = rx_Write(
-                       ((struct rxfs_storeVariables*)rock)->call, tbuffer, tlen);
-               RX_AFS_GLOCK();
-
-               if (bsent != tlen) {
-                   code = -33; /* XXX */
-                   break;
-               }
-               sbytes -= tlen;
-           }
-           osi_FreeLargeSpace(tbuffer);
+           code = (*ops->padd)(rock, afs_OtherCSize - tdc->f.chunkBytes);
        }
        stored += tdc->f.chunkBytes;
        /* ideally, I'd like to unlock the dcache and turn