* but the vnode involved may or may not be locked depending on whether
* or not the CM_BUF_WRITE_SCP_LOCKED flag is set.
*/
- long code, code1;
+ long code;
cm_scache_t *scp = vscp;
afs_int32 nbytes;
afs_int32 save_nbytes;
}
}
- code1 = rx_EndCall(rxcallp, code);
+ /* Prefer rx_EndCall error over StoreData error. Note that this will
+ * never set 'code' to 0 if we passed in a non-zero code. */
+ code = rx_EndCall(rxcallp, code);
- if ((code == RXGEN_OPCODE || code1 == RXGEN_OPCODE) && SERVERHAS64BIT(connp)) {
+ if (code == RXGEN_OPCODE && SERVERHAS64BIT(connp)) {
SET_SERVERHASNO64BIT(connp);
qdp = NULL;
nbytes = save_nbytes;
goto retry;
}
- /* Prefer rx_EndCall error over StoreData error */
- if (code1 != 0) {
- osi_Log2(afsd_logp, "rx_EndCall converted 0x%x to 0x%x", code, code1);
- code = code1;
- }
} while (cm_Analyze(connp, userp, reqp, &scp->fid, NULL, 1, &outStatus, &volSync, NULL, NULL, code));
code = cm_MapRPCError(code, reqp);
AFSStoreStatus inStatus;
AFSVolSync volSync;
AFSFid tfid;
- long code, code1;
+ long code;
osi_hyper_t truncPos;
cm_conn_t *connp;
struct rx_call *rxcallp;
int call_was_64bit = 0;
memset(&volSync, 0, sizeof(volSync));
+ memset(&inStatus, 0, sizeof(inStatus);
osi_Log2(afsd_logp, "cm_StoreMini scp 0x%p userp 0x%p", scp, userp);
osi_Log0(afsd_logp, "EndRXAFS_StoreData SUCCESS");
}
}
- code1 = rx_EndCall(rxcallp, code);
+ code = rx_EndCall(rxcallp, code);
- if ((code == RXGEN_OPCODE || code1 == RXGEN_OPCODE) && SERVERHAS64BIT(connp)) {
+ if (code == RXGEN_OPCODE && SERVERHAS64BIT(connp)) {
SET_SERVERHASNO64BIT(connp);
goto retry;
}
-
- /* prefer StoreData error over rx_EndCall error */
- if (code == 0 && code1 != 0)
- code = code1;
} while (cm_Analyze(connp, userp, reqp, &scp->fid, NULL, 1, &outStatus, &volSync, NULL, NULL, code));
code = cm_MapRPCError(code, reqp);
long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *userp,
cm_req_t *reqp)
{
- long code=0, code1=0;
+ long code=0;
afs_uint32 nbytes; /* bytes in transfer */
afs_uint32 nbytes_hi = 0; /* high-order 32 bits of bytes in transfer */
afs_uint64 length_found = 0;
/* now make the call */
do {
+ long code1;
+
code = cm_ConnFromFID(&scp->fid, userp, reqp, &connp);
if (code)
continue;
nbytes_hi = ntohl(nbytes_hi);
} else {
nbytes_hi = 0;
- code = rx_Error(rxcallp);
- code1 = rx_EndCall(rxcallp, code);
+ code = rx_EndCall(rxcallp, RX_PROTOCOL_ERROR);
rxcallp = NULL;
}
}
osi_Log1(afsd_logp, "CALL EndRXAFS_FetchData skipped due to error %d", code);
}
+ code1 = code;
if (rxcallp)
code1 = rx_EndCall(rxcallp, code);
scp_locked = 0;
}
code = 0;
- /* Prefer the error value from FetchData over rx_EndCall */
- } else if (code == 0 && code1 != 0)
+ } else {
+ /* Prefer the error from rx_EndCall over any other error */
code = code1;
+ }
osi_Log0(afsd_logp, "CALL FetchData DONE");
} while (cm_Analyze(connp, userp, reqp, &scp->fid, NULL, 0, &afsStatus, &volSync, NULL, NULL, code));
long cm_GetData(cm_scache_t *scp, osi_hyper_t *offsetp, char *datap, int data_length,
int * bytes_readp, cm_user_t *userp, cm_req_t *reqp)
{
- long code=0, code1=0;
+ long code=0;
afs_uint32 nbytes; /* bytes in transfer */
afs_uint32 nbytes_hi = 0; /* high-order 32 bits of bytes in transfer */
afs_uint64 length_found = 0;
/* now make the call */
do {
+ long code1;
+
code = cm_ConnFromFID(&scp->fid, userp, reqp, &connp);
if (code)
continue;
nbytes_hi = ntohl(nbytes_hi);
} else {
nbytes_hi = 0;
- code = rx_Error(rxcallp);
- code1 = rx_EndCall(rxcallp, code);
+ code = rx_EndCall(rxcallp, RX_PROTOCOL_ERROR);
rxcallp = NULL;
}
}
osi_Log1(afsd_logp, "CALL EndRXAFS_FetchData skipped due to error %d", code);
}
+ code1 = code;
if (rxcallp)
code1 = rx_EndCall(rxcallp, code);
scp_locked = 0;
}
code = 0;
- /* Prefer the error value from FetchData over rx_EndCall */
- } else if (code == 0 && code1 != 0)
+ } else {
+ /* Prefer the error from rx_EndCall over any other error */
code = code1;
+ }
osi_Log0(afsd_logp, "CALL FetchData DONE");
} while (cm_Analyze(connp, userp, reqp, &scp->fid, NULL, 0, &afsStatus, &volSync, NULL, NULL, code));
long
cm_VerifyStoreData(cm_bulkIO_t *biod, cm_scache_t *savedScp)
{
- long code=0, code1=0;
+ long code=0;
afs_uint32 nbytes; /* bytes in transfer */
afs_uint32 nbytes_hi = 0; /* high-order 32 bits of bytes in transfer */
afs_uint64 length_found = 0;
/* now make the call */
do {
+ long code1;
+
code = cm_ConnFromFID(&scp->fid, userp, reqp, &connp);
if (code)
continue;
nbytes_hi = ntohl(nbytes_hi);
} else {
nbytes_hi = 0;
- code = rx_Error(rxcallp);
- code1 = rx_EndCall(rxcallp, code);
+ code = rx_EndCall(rxcallp, RX_PROTOCOL_ERROR);
rxcallp = NULL;
}
}
osi_Log1(afsd_logp, "CALL EndRXAFS_FetchData skipped due to error %d", code);
}
+ code1 = code;
if (rxcallp)
code1 = rx_EndCall(rxcallp, code);
scp_locked = 0;
}
code = 0;
- /* Prefer the error value from FetchData over rx_EndCall */
- } else if (code == 0 && code1 != 0)
+ } else {
+ /* Prefer the error from rx_EndCall over any other error */
code = code1;
+ }
osi_Log0(afsd_logp, "CALL FetchData DONE");
} while (cm_Analyze(connp, userp, reqp, &scp->fid, NULL, 0, &afsStatus, &volSync, NULL, NULL, code));