struct rxfs_storeVariables *v = (struct rxfs_storeVariables *)*r;
*r = NULL;
+ if (v->call) {
+ afs_int32 code2;
+ RX_AFS_GUNLOCK();
+ code2 = rx_EndCall(v->call, code);
+ RX_AFS_GLOCK();
+ if (code2)
+ code = code2;
+ }
if (v->tbuffer)
osi_FreeLargeSpace(v->tbuffer);
if (v->tiov)
};
afs_int32
-rxfs_storeInit(struct vcache *avc, struct storeOps **ops, void **rock)
+rxfs_storeInit(struct vcache *avc, struct afs_conn *tc, afs_size_t tlen,
+ afs_size_t bytes, afs_size_t base,
+ struct storeOps **ops, void **rock)
{
+ afs_int32 code;
struct rxfs_storeVariables *v;
+ struct rx_call *tcall;
+
+ if ( !tc )
+ return -1;
v = (struct rxfs_storeVariables *) osi_AllocSmallSpace(sizeof(struct rxfs_storeVariables));
if (!v)
v->InStatus.ClientModTime = avc->f.m.Date;
v->InStatus.Mask = AFS_SETMODTIME;
+ RX_AFS_GUNLOCK();
+ tcall = rx_NewCall(tc->id);
+#ifdef AFS_64BIT_CLIENT
+ if (!afs_serverHasNo64Bit(tc))
+ code = StartRXAFS_StoreData64(tcall, (struct AFSFid *) &avc->f.fid.Fid,
+ &v->InStatus, base, bytes, tlen);
+ else {
+ if (tlen > 0xFFFFFFFF) {
+ code = EFBIG;
+ }
+ else {
+ afs_int32 t1, t2, t3;
+ t1 = base;
+ t2 = bytes;
+ t3 = tlen;
+ code = StartRXAFS_StoreData(tcall, (struct AFSFid *)&avc->f.fid.Fid,
+ &v->InStatus, t1, t2, t3);
+ }
+ }
+#else /* AFS_64BIT_CLIENT */
+ code = StartRXAFS_StoreData(tcall, (struct AFSFid *)&avc->f.fid.Fid,
+ &v->InStatus, base, bytes, tlen);
+#endif /* AFS_64BIT_CLIENT */
+ RX_AFS_GLOCK();
+
if (cacheDiskType == AFS_FCACHE_TYPE_UFS) {
v->tbuffer = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
if (!v->tbuffer)
}
#endif /* notdef */
}
+
+ v->call = tcall;
*rock = (void *)v;
return 0;
}
/*!
* Called upon store.
*
- * \param acall Ptr to the Rx call structure involved.
+ * \param tc Ptr to the Rx connection structure involved.
* \param dclist pointer to the list of dcaches
* \param avc Ptr to the vcache entry.
* \param bytes per chunk
+ * \param base where to start the store
+ * \param length number of bytes to store
* \param anewDV Ptr to the dataversion after store
* \param doProcessFS Ptr to the processFS flag
* \param OutStatus Ptr to the OutStatus structure
* \note Environment: Nothing interesting.
*/
int
-afs_CacheStoreProc(register struct rx_call *acall,
+afs_CacheStoreProc(register struct afs_conn *tc,
struct dcache **dclist,
struct vcache *avc,
afs_size_t bytes,
+ afs_size_t base,
+ afs_size_t length,
afs_hyper_t *anewDV,
int *doProcessFS,
struct AFSFetchStatus *OutStatus,
#endif /* AFS_NOSTATS */
XSTATS_DECLS;
- code = rxfs_storeInit(avc, &ops, &rock);
+ code = rxfs_storeInit(avc, tc, length, bytes, base, &ops, &rock);
if ( code ) {
- osi_Panic("afs_CacheStoreProc: rxfs_storeInit failed");
+ osi_Panic("afs_CacheStoreProc: rxfs_storeInit failed with %d", code);
}
- ((struct rxfs_storeVariables *)rock)->call = acall;
for (i = 0; i < nchunks && !code; i++) {
int offset = 0;
int nomore;
unsigned int first = 0;
struct afs_conn *tc;
- struct rx_call *tcall;
- XSTATS_DECLS;
for (bytes = 0, j = 0; !code && j <= high; j++) {
if (dcList[j]) {
ObtainSharedLock(&(dcList[j]->lock), 629);
do {
tc = afs_Conn(&avc->f.fid, areq, 0);
- if (tc) {
#ifdef AFS_64BIT_CLIENT
- restart:
+ restart:
#endif
- RX_AFS_GUNLOCK();
- tcall = rx_NewCall(tc->id);
-#ifdef AFS_64BIT_CLIENT
- if (!afs_serverHasNo64Bit(tc)) {
- code =
- StartRXAFS_StoreData64(tcall,
- (struct AFSFid *)
- &avc->f.fid.Fid,
- &InStatus, base,
- bytes, tlen);
- } else {
- if (tlen > 0xFFFFFFFF) {
- code = EFBIG;
- } else {
- afs_int32 t1, t2, t3;
- t1 = base;
- t2 = bytes;
- t3 = tlen;
- code =
- StartRXAFS_StoreData(tcall,
- (struct AFSFid *)
- &avc->f.fid.Fid,
- &InStatus, t1,
- t2, t3);
- }
- }
-#else /* AFS_64BIT_CLIENT */
- code =
- StartRXAFS_StoreData(tcall,
- (struct AFSFid *)&avc->
- f.fid.Fid, &InStatus, base,
- bytes, tlen);
-#endif /* AFS_64BIT_CLIENT */
- RX_AFS_GLOCK();
- } else {
- code = -1;
- tcall = NULL;
- }
- if ( !code )
- code = afs_CacheStoreProc(tcall, dclist,
- avc, bytes,
- &newDV, &doProcessFS, &OutStatus,
- nchunks, &nomore);
- if (tcall) {
- afs_int32 code2;
- RX_AFS_GUNLOCK();
- code2 = rx_EndCall(tcall, code);
- RX_AFS_GLOCK();
- if (code2)
- code = code2;
- }
+ code = afs_CacheStoreProc(tc, dclist,
+ avc, bytes, base, tlen,
+ &newDV, &doProcessFS, &OutStatus,
+ nchunks, &nomore);
#ifdef AFS_64BIT_CLIENT
if (code == RXGEN_OPCODE && !afs_serverHasNo64Bit(tc)) {
afs_serverSetNo64Bit(tc);