* 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 */
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));
else
InterlockedDecrement(&scp->activeRPCs);
+ *bytes_readp = (long) (bufferp - datap);
+
return code;
}
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,
{
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;
{
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;