diff --git a/src/WINNT/afsd/cm_dcache.c b/src/WINNT/afsd/cm_dcache.c index 5ced48f85f..6dc23fd0c4 100644 --- a/src/WINNT/afsd/cm_dcache.c +++ b/src/WINNT/afsd/cm_dcache.c @@ -2222,7 +2222,7 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *userp * a provided buffer. Called with scp locked. The scp is locked on return. */ long cm_GetData(cm_scache_t *scp, osi_hyper_t *offsetp, char *datap, int data_length, - cm_user_t *userp, cm_req_t *reqp) + int * bytes_readp, cm_user_t *userp, cm_req_t *reqp) { long code=0, code1=0; afs_uint32 nbytes; /* bytes in transfer */ @@ -2247,6 +2247,9 @@ long cm_GetData(cm_scache_t *scp, osi_hyper_t *offsetp, char *datap, int data_le int first_read = 1; int scp_locked = 1; + if (bytes_readp) + *bytes_readp = 0; + memset(&afsStatus, 0, sizeof(afsStatus)); memset(&callback, 0, sizeof(callback)); memset(&volSync, 0, sizeof(volSync)); @@ -2571,6 +2574,8 @@ long cm_GetData(cm_scache_t *scp, osi_hyper_t *offsetp, char *datap, int data_le else InterlockedDecrement(&scp->activeRPCs); + *bytes_readp = (long) (bufferp - datap); + return code; } diff --git a/src/WINNT/afsd/cm_dcache.h b/src/WINNT/afsd/cm_dcache.h index 00f122be04..4ca9039f65 100644 --- a/src/WINNT/afsd/cm_dcache.h +++ b/src/WINNT/afsd/cm_dcache.h @@ -37,7 +37,7 @@ extern long cm_GetBuffer(struct cm_scache *, struct cm_buf *, int *, struct cm_user *, struct cm_req *); extern long cm_GetData(cm_scache_t *scp, osi_hyper_t *offsetp, char *datap, int data_length, - cm_user_t *userp, cm_req_t *reqp); + int * bytes_readp, cm_user_t *userp, cm_req_t *reqp); extern afs_int32 cm_CheckFetchRange(cm_scache_t *scp, osi_hyper_t *startBasep, osi_hyper_t *length, cm_user_t *up, diff --git a/src/WINNT/afsd/cm_vnodeops.c b/src/WINNT/afsd/cm_vnodeops.c index 50fa010f47..7e8422c834 100644 --- a/src/WINNT/afsd/cm_vnodeops.c +++ b/src/WINNT/afsd/cm_vnodeops.c @@ -860,10 +860,11 @@ long cm_ReadMountPoint(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp) { char temp[MOUNTPOINTLEN]; osi_hyper_t offset; + afs_uint32 bytesRead = 0; /* otherwise, we have to read it in */ offset.LowPart = offset.HighPart = 0; - code = cm_GetData(scp, &offset, temp, MOUNTPOINTLEN, userp, reqp); + code = cm_GetData(scp, &offset, temp, MOUNTPOINTLEN, &bytesRead, userp, reqp); if (code) goto done; @@ -1789,10 +1790,11 @@ long cm_HandleLink(cm_scache_t *linkScp, cm_user_t *userp, cm_req_t *reqp) { char temp[MOUNTPOINTLEN]; osi_hyper_t offset; + afs_uint32 bytesRead = 0; /* read the link data from the file server */ offset.LowPart = offset.HighPart = 0; - code = cm_GetData(linkScp, &offset, temp, MOUNTPOINTLEN, userp, reqp); + code = cm_GetData(linkScp, &offset, temp, MOUNTPOINTLEN, &bytesRead, userp, reqp); if (code) return code;