register struct volser_trans *tt, **lt;
afs_int32 error;
+ if (lock) VTRANS_LOCK;
if (atrans->refCount > 1) {
/* someone else is using it now */
atrans->refCount--;
atrans->tflags |= TTDeleted;
+ if (lock) VTRANS_UNLOCK;
return 0;
}
/* otherwise we zap it ourselves */
- if (lock) VTRANS_LOCK;
lt = &allTrans;
for (tt = *lt; tt; lt = &tt->next, tt = *lt) {
if (tt == atrans) {
if (tt->volume)
VDetachVolume(&error, tt->volume);
tt->volume = NULL;
+ if (tt->rxCallPtr)
+ rxi_CallError(tt->rxCallPtr, RX_CALL_DEAD);
*lt = tt->next;
free(tt);
if (lock) VTRANS_UNLOCK;
afs_int32
TRELE(register struct volser_trans *at)
{
+ VTRANS_LOCK;
if (at->refCount == 0) {
Log("TRELE: bad refcount\n");
+ VTRANS_UNLOCK;
return VOLSERTRELE_ERROR;
}
at->time = FT_ApproxTime(); /* we're still using it */
if (at->refCount == 1 && (at->tflags & TTDeleted)) {
- DeleteTrans(at, 1);
+ DeleteTrans(at, 0);
+ VTRANS_UNLOCK;
return 0;
}
/* otherwise simply drop refcount */
at->refCount--;
+ VTRANS_UNLOCK;
return 0;
}