* space from the buffer pool. In that case, the buffer will be returned
* without being hashed into the hash table.
*/
-long buf_GetNewLocked(struct cm_scache *scp, osi_hyper_t *offsetp, cm_buf_t **bufpp)
+long buf_GetNewLocked(struct cm_scache *scp, osi_hyper_t *offsetp, cm_req_t *reqp, cm_buf_t **bufpp)
{
cm_buf_t *bp; /* buffer we're dealing with */
cm_buf_t *nextBp; /* next buffer in file hash chain */
afs_uint32 i; /* temp */
- cm_req_t req;
-
- cm_InitReq(&req); /* just in case */
#ifdef TESTING
buf_ValidateBufQueues();
* have the WRITING flag set, so we won't get
* back here.
*/
- buf_CleanAsync(bp, &req, NULL);
+ buf_CleanAsync(bp, reqp, NULL);
/* now put it back and go around again */
buf_Release(bp);
/* get a page, returning it held but unlocked. Doesn't fill in the page
* with I/O, since we're going to write the whole thing new.
*/
-long buf_GetNew(struct cm_scache *scp, osi_hyper_t *offsetp, cm_buf_t **bufpp)
+long buf_GetNew(struct cm_scache *scp, osi_hyper_t *offsetp, cm_req_t *reqp, cm_buf_t **bufpp)
{
cm_buf_t *bp;
long code;
}
/* otherwise, we have to create a page */
- code = buf_GetNewLocked(scp, &pageOffset, &bp);
+ code = buf_GetNewLocked(scp, &pageOffset, reqp, &bp);
/* check if the buffer was created in a race condition branch.
* If so, go around so we can hold a reference to it.
/* get a page, returning it held but unlocked. Make sure it is complete */
/* The scp must be unlocked when passed to this function */
-long buf_Get(struct cm_scache *scp, osi_hyper_t *offsetp, cm_buf_t **bufpp)
+long buf_Get(struct cm_scache *scp, osi_hyper_t *offsetp, cm_req_t *reqp, cm_buf_t **bufpp)
{
cm_buf_t *bp;
long code;
}
/* otherwise, we have to create a page */
- code = buf_GetNewLocked(scp, &pageOffset, &bp);
+ code = buf_GetNewLocked(scp, &pageOffset, reqp, &bp);
/* bp->mx is now held */
/* check if the buffer was created in a race condition branch.
extern cm_buf_t *buf_Find(struct cm_scache *, osi_hyper_t *);
-extern long buf_GetNewLocked(struct cm_scache *, osi_hyper_t *, cm_buf_t **);
+extern long buf_GetNewLocked(struct cm_scache *, osi_hyper_t *, cm_req_t *, cm_buf_t **);
-extern long buf_Get(struct cm_scache *, osi_hyper_t *, cm_buf_t **);
+extern long buf_Get(struct cm_scache *, osi_hyper_t *, cm_req_t *, cm_buf_t **);
-extern long buf_GetNew(struct cm_scache *, osi_hyper_t *, cm_buf_t **);
+extern long buf_GetNew(struct cm_scache *, osi_hyper_t *, cm_req_t *, cm_buf_t **);
extern afs_uint32 buf_CleanAsyncLocked(cm_buf_t *, cm_req_t *, afs_uint32 *);
mxheld = 0;
}
- code = buf_Get(scp, &offset, &bp);
+ code = buf_Get(scp, &offset, &req, &bp);
if (code)
break;
if (LargeIntegerGreaterThanOrEqualTo(pageBase, fileSize))
break;
- code = buf_Get(scp, &pageBase, &tbp);
+ code = buf_Get(scp, &pageBase, reqp, &tbp);
if (code) {
lock_ObtainWrite(&scp->rw);
cm_SyncOpDone(scp, NULL, CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
offset.HighPart, offset.LowPart);
lock_ReleaseWrite(&op->scp->rw);
- code = buf_Get(op->scp, &offset, &bufferp);
+ code = buf_Get(op->scp, &offset, &op->req, &bufferp);
lock_ObtainWrite(&op->scp->rw);
goto _has_buffer;
}
- code = buf_Get(op->scp, &bufferOffset, &bufferp);
+ code = buf_Get(op->scp, &bufferOffset, &op->req, &bufferp);
if (code) {
osi_Log1(afsd_logp, " buf_Get returned code 0x%x", code);
bufferp = NULL;
return code;
thyper.HighPart = 0; thyper.LowPart = 0;
- code = buf_Get(scp, &thyper, &bufferp);
+ code = buf_Get(scp, &thyper, reqp, &bufferp);
if (code)
return code;
bufferp = NULL;
}
- code = buf_Get(scp, &thyper, &bufferp);
+ code = buf_Get(scp, &thyper, reqp, &bufferp);
if (code) {
/* if buf_Get() fails we do not have a buffer object to lock */
bufferp = NULL;
lock_ReleaseWrite(&scp->rw);
thyper.LowPart = thyper.HighPart = 0;
- code = buf_Get(scp, &thyper, &bufp);
+ code = buf_Get(scp, &thyper, reqp, &bufp);
lock_ObtainWrite(&scp->rw);
if (code)
/* read the link data from the file server*/
lock_ReleaseWrite(&linkScp->rw);
thyper.LowPart = thyper.HighPart = 0;
- code = buf_Get(linkScp, &thyper, &bufp);
+ code = buf_Get(linkScp, &thyper, reqp, &bufp);
lock_ObtainWrite(&linkScp->rw);
if (code)
return code;
}
lock_ReleaseWrite(&scp->rw);
- code = buf_Get(scp, &thyper, &bufferp);
+ code = buf_Get(scp, &thyper, &req, &bufferp);
lock_ObtainWrite(&scp->rw);
if (code) goto done;
}
lock_ReleaseWrite(&scp->rw);
- code = buf_Get(scp, &thyper, &bufferp);
+ code = buf_Get(scp, &thyper, &req, &bufferp);
lock_ObtainMutex(&bufferp->mx);
lock_ObtainWrite(&scp->rw);
bufferp = NULL;
}
lock_ReleaseWrite(&scp->rw);
- code = buf_Get(scp, &thyper, &bufferp);
+ code = buf_Get(scp, &thyper, &req, &bufferp);
lock_ObtainMutex(&dsp->mx);
/* now, if we're doing a star match, do bulk fetching of all of
}
lock_ReleaseWrite(&scp->rw);
- code = buf_Get(scp, &thyper, &bufferp);
+ code = buf_Get(scp, &thyper, &req, &bufferp);
lock_ObtainWrite(&scp->rw);
if (code) goto done;
}
lock_ReleaseWrite(&scp->rw);
- code = buf_Get(scp, &thyper, &bufferp);
+ code = buf_Get(scp, &thyper, &req, &bufferp);
lock_ObtainMutex(&bufferp->mx);
lock_ObtainWrite(&scp->rw);
bufferp = NULL;
}
lock_ReleaseWrite(&scp->rw);
- code = buf_Get(scp, &thyper, &bufferp);
+ code = buf_Get(scp, &thyper, &req, &bufferp);
lock_ObtainWrite(&scp->rw);
if (code) {
osi_Log2(smb_logp, "T2 search dir buf_Get scp %x failed %d", scp, code);