{
struct afs_stats_xferData *xferP;
osi_timeval_t xferStopTime;
- XSTATS_DECLS;
+ osi_timeval_t elapsedTime;
xferP = &(afs_stats_cmfullperf.rpc.fsXferTimes[idx]);
osi_GetuTime(&xferStopTime);
struct rx_call *call;
char *tbuffer;
struct iovec *tiov;
- afs_uint32 tnio;
+ afs_int32 tnio;
afs_int32 hasNo64bit;
struct AFSStoreStatus InStatus;
};
return -33; /* XXX */
size -= tlen;
}
- return code;
+ return 0;
}
afs_int32
while ( size > 0 ) {
afs_uint32 tlen;
- afs_int32 bytesread, byteswritten;
+ afs_uint32 bytesread, byteswritten;
code = (*ops->prepare)(rock, size, &tlen);
if ( code )
break;
ICL_HANDLE_OFFSET(base), ICL_TYPE_OFFSET,
ICL_HANDLE_OFFSET(bytes), ICL_TYPE_OFFSET,
ICL_HANDLE_OFFSET(length));
- tc = afs_Conn(&avc->f.fid, areq, 0);
do {
+ tc = afs_Conn(&avc->f.fid, areq, 0);
+
#ifdef AFS_64BIT_CLIENT
restart:
#endif
code = rxfs_storeInit(avc, tc, base, bytes, length,
- sync, &ops, &rock);
- if ( code )
- goto nocall;
-
- code = afs_CacheStoreDCaches(avc, dclist, bytes, anewDV,
- &doProcessFS, &OutStatus, nchunks, nomore, ops, rock);
+ sync, &ops, &rock);
+ if ( !code ) {
+ code = afs_CacheStoreDCaches(avc, dclist, bytes, anewDV,
+ &doProcessFS, &OutStatus,
+ nchunks, nomore, ops, rock);
+ }
-nocall:
#ifdef AFS_64BIT_CLIENT
if (code == RXGEN_OPCODE && !afs_serverHasNo64Bit(tc)) {
afs_serverSetNo64Bit(tc);
goto restart;
}
-#else
- continue; /* dummy, label before block end won't work */
#endif /* AFS_64BIT_CLIENT */
} while (afs_Analyze
(tc, code, &avc->f.fid, areq,
struct rx_call *call;
char *tbuffer;
struct iovec *iov;
- afs_uint32 nio;
+ afs_int32 nio;
afs_int32 hasNo64bit;
afs_int32 iovno;
afs_int32 iovmax;
}
afs_int32
-rxfs_fetchMore(void *r, afs_uint32 *length, afs_uint32 *moredata)
+rxfs_fetchMore(void *r, afs_int32 *length, afs_uint32 *moredata)
{
afs_int32 code;
struct rxfs_fetchVariables *v = (struct rxfs_fetchVariables *)r;
* We do not do this for AFS file servers because they sometimes
* return large negative numbers as the transfer size.
*/
- RX_AFS_GUNLOCK();
- code = rx_Read(v->call, (void *)length, sizeof(afs_int32));
- RX_AFS_GLOCK();
- *length = ntohl(*length);
- if (code != sizeof(afs_int32)) {
- code = rx_Error(v->call);
- *moredata = 0;
- return (code ? code : -1); /* try to return code, not -1 */
+ if (*moredata) {
+ RX_AFS_GUNLOCK();
+ code = rx_Read(v->call, (void *)length, sizeof(afs_int32));
+ RX_AFS_GLOCK();
+ *length = ntohl(*length);
+ if (code != sizeof(afs_int32)) {
+ code = rx_Error(v->call);
+ *moredata = 0;
+ return (code ? code : -1); /* try to return code, not -1 */
+ }
}
*moredata = *length & 0x80000000;
*length &= ~0x80000000;
afs_int32
rxfs_fetchInit(struct afs_conn *tc, struct vcache *avc, afs_offs_t base,
- afs_uint32 size, afs_int32 *alength, afs_uint32 *moredata,
- struct dcache *adc,
+ afs_uint32 size, afs_int32 *alength, struct dcache *adc,
struct osi_file *fP, struct fetchOps **ops, void **rock)
{
struct rxfs_fetchVariables *v;
int code = 0, code1;
- afs_uint32 length_hi = 0, length, bytes;
+#ifdef AFS_64BIT_CLIENT
+ afs_uint32 length_hi = 0;
+#endif
+ afs_uint32 length, bytes;
v = (struct rxfs_fetchVariables *) osi_AllocSmallSpace(sizeof(struct rxfs_fetchVariables));
if (!v)
osi_FreeSmallSpace(v);
return code;
}
- /*
- * The fetch protocol is extended for the AFS/DFS translator
- * to allow multiple blocks of data, each with its own length,
- * to be returned. As long as the top bit is set, there are more
- * blocks expected.
- *
- * We do not do this for AFS file servers because they sometimes
- * return large negative numbers as the transfer size.
- *
- * Also omit if length > 2^32, as bit 31 is part of the number then.
- * Known to never be the case ifndef AFS_64BIT_CLIENT.
- */
- if (avc->f.states & CForeign && !length_hi) {
- *moredata = length & 0x80000000;
- length &= ~0x80000000;
- }
if (cacheDiskType == AFS_FCACHE_TYPE_UFS) {
v->tbuffer = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
if (!v->tbuffer)
afs_uint32 bytesread, byteswritten;
struct fetchOps *ops = NULL;
void *rock = NULL;
- int moredata = 0;
+ afs_uint32 moredata = 0;
int offset = 0;
XSTATS_DECLS;
* adc->lock(W)
*/
code = rxfs_fetchInit(
- tc, avc, base, size, &length, &moredata, adc, fP, &ops, &rock);
+ tc, avc, base, size, &length, adc, fP, &ops, &rock);
#ifndef AFS_NOSTATS
osi_GetuTime(&xferStartTime);
}
if ( !code ) do {
- if ((avc->f.states & CForeign) && moredata && !length) {
+ if (avc->f.states & CForeign) {
code = (*ops->more)(rock, &length, &moredata);
if ( code )
break;