struct vcache *tvc;
struct volume *volp = 0;
struct afs_fakestat_state fakestate;
+ struct rx_connection *rxconn;
XSTATS_DECLS;
OSI_VC_CONVERT(adp);
InStatus.UnixModeBits = attrs->va_mode & 0xffff; /* only care about protection bits */
do {
- tc = afs_Conn(&adp->f.fid, &treq, SHARED_LOCK);
+ tc = afs_Conn(&adp->f.fid, &treq, SHARED_LOCK, &rxconn);
if (tc) {
hostp = tc->parent->srvr->server; /* remember for callback processing */
now = osi_Time();
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_CREATEFILE);
RX_AFS_GUNLOCK();
code =
- RXAFS_CreateFile(tc->id, (struct AFSFid *)&adp->f.fid.Fid,
+ RXAFS_CreateFile(rxconn, (struct AFSFid *)&adp->f.fid.Fid,
aname, &InStatus, (struct AFSFid *)
&newFid.Fid, &OutFidStatus, &OutDirStatus,
&CallBack, &tsync);
} else
code = -1;
} while (afs_Analyze
- (tc, code, &adp->f.fid, &treq, AFS_STATS_FS_RPCIDX_CREATEFILE,
+ (tc, rxconn, code, &adp->f.fid, &treq, AFS_STATS_FS_RPCIDX_CREATEFILE,
SHARED_LOCK, NULL));
if ((code == EEXIST || code == UAEEXIST) &&
struct vrequest treq;
afs_int32 code;
struct afs_conn *tc;
+ struct rx_connection *rxconn;
struct VenusFid newFid;
struct dcache *tdc;
struct dcache *new_dc;
if (!AFS_IS_DISCON_RW) {
do {
- tc = afs_Conn(&adp->f.fid, &treq, SHARED_LOCK);
+ tc = afs_Conn(&adp->f.fid, &treq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_MAKEDIR);
now = osi_Time();
RX_AFS_GUNLOCK();
code =
- RXAFS_MakeDir(tc->id,
+ RXAFS_MakeDir(rxconn,
(struct AFSFid *)&adp->f.fid.Fid,
aname,
&InStatus,
} else
code = -1;
} while (afs_Analyze
- (tc, code, &adp->f.fid, &treq, AFS_STATS_FS_RPCIDX_MAKEDIR,
+ (tc, rxconn, code, &adp->f.fid, &treq, AFS_STATS_FS_RPCIDX_MAKEDIR,
SHARED_LOCK, NULL));
if (code) {
struct AFSFetchStatus OutDirStatus;
struct AFSVolSync tsync;
struct afs_fakestat_state fakestate;
+ struct rx_connection *rxconn;
XSTATS_DECLS;
OSI_VC_CONVERT(adp);
if (!AFS_IS_DISCON_RW) {
/* Not disconnected, can connect to server. */
do {
- tc = afs_Conn(&adp->f.fid, &treq, SHARED_LOCK);
+ tc = afs_Conn(&adp->f.fid, &treq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_REMOVEDIR);
RX_AFS_GUNLOCK();
code =
- RXAFS_RemoveDir(tc->id,
+ RXAFS_RemoveDir(rxconn,
(struct AFSFid *)&adp->f.fid.Fid,
aname,
&OutDirStatus,
} else
code = -1;
} while (afs_Analyze
- (tc, code, &adp->f.fid, &treq, AFS_STATS_FS_RPCIDX_REMOVEDIR,
+ (tc, rxconn, code, &adp->f.fid, &treq, AFS_STATS_FS_RPCIDX_REMOVEDIR,
SHARED_LOCK, NULL));
if (code) {
}
if (avc->flockCount == 0) {
if (!AFS_IS_DISCONNECTED) {
+ struct rx_connection *rxconn;
do {
- tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_RELEASELOCK);
RX_AFS_GUNLOCK();
- code = RXAFS_ReleaseLock(tc->id, (struct AFSFid *)
+ code = RXAFS_ReleaseLock(rxconn, (struct AFSFid *)
&avc->f.fid.Fid, &tsync);
RX_AFS_GLOCK();
XSTATS_END_TIME;
} else
code = -1;
} while (afs_Analyze
- (tc, code, &avc->f.fid, areq,
+ (tc, rxconn, code, &avc->f.fid, areq,
AFS_STATS_FS_RPCIDX_RELEASELOCK, SHARED_LOCK, NULL));
} else {
/*printf("Network is dooooooowwwwwwwnnnnnnn\n");*/
}
if (!code && avc->flockCount == 0) {
if (!AFS_IS_DISCONNECTED) {
+ struct rx_connection *rxconn;
do {
- tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME
(AFS_STATS_FS_RPCIDX_RELEASELOCK);
RX_AFS_GUNLOCK();
code =
- RXAFS_ReleaseLock(tc->id,
+ RXAFS_ReleaseLock(rxconn,
(struct AFSFid *)&avc->
f.fid.Fid, &tsync);
RX_AFS_GLOCK();
} else
code = -1;
} while (afs_Analyze
- (tc, code, &avc->f.fid, areq,
+ (tc, rxconn, code, &avc->f.fid, areq,
AFS_STATS_FS_RPCIDX_RELEASELOCK, SHARED_LOCK,
NULL));
}
* we've already checked for compatibility), we shouldn't send
* the call through to the server again */
if (avc->flockCount == 0) {
+ struct rx_connection *rxconn;
/* we're the first on our block, send the call through */
lockType = ((acom & LOCK_EX) ? LockWrite : LockRead);
if (!AFS_IS_DISCONNECTED) {
do {
- tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_SETLOCK);
RX_AFS_GUNLOCK();
- code = RXAFS_SetLock(tc->id, (struct AFSFid *)
+ code = RXAFS_SetLock(rxconn, (struct AFSFid *)
&avc->f.fid.Fid, lockType,
&tsync);
RX_AFS_GLOCK();
} else
code = -1;
} while (afs_Analyze
- (tc, code, &avc->f.fid, areq,
+ (tc, rxconn, code, &avc->f.fid, areq,
AFS_STATS_FS_RPCIDX_SETLOCK, SHARED_LOCK,
NULL));
if ((lockType == LockWrite) && (code == VREADONLY))
struct AFSFetchStatus OutStatus;
struct AFSCallBack CallBack;
struct AFSVolSync tsync;
+ struct rx_connection *rxconn;
int temp;
XSTATS_DECLS;
temp = areq->flags & O_NONBLOCK;
return 0;
do {
- tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHSTATUS);
RX_AFS_GUNLOCK();
code =
- RXAFS_FetchStatus(tc->id, (struct AFSFid *)&avc->f.fid.Fid,
+ RXAFS_FetchStatus(rxconn, (struct AFSFid *)&avc->f.fid.Fid,
&OutStatus, &CallBack, &tsync);
RX_AFS_GLOCK();
XSTATS_END_TIME;
} else
code = -1;
} while (afs_Analyze
- (tc, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_FETCHSTATUS,
+ (tc, rxconn, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_FETCHSTATUS,
SHARED_LOCK, NULL));
if (temp)
struct AFSFetchStatus OutFidStatus, OutDirStatus;
struct AFSVolSync tsync;
struct afs_fakestat_state vfakestate, dfakestate;
+ struct rx_connection *rxconn;
XSTATS_DECLS;
OSI_VC_CONVERT(adp);
tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1); /* test for error below */
ObtainWriteLock(&adp->lock, 145);
do {
- tc = afs_Conn(&adp->f.fid, &treq, SHARED_LOCK);
+ tc = afs_Conn(&adp->f.fid, &treq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_LINK);
RX_AFS_GUNLOCK();
code =
- RXAFS_Link(tc->id, (struct AFSFid *)&adp->f.fid.Fid, aname,
+ RXAFS_Link(rxconn, (struct AFSFid *)&adp->f.fid.Fid, aname,
(struct AFSFid *)&avc->f.fid.Fid, &OutFidStatus,
&OutDirStatus, &tsync);
RX_AFS_GLOCK();
} else
code = -1;
} while (afs_Analyze
- (tc, code, &adp->f.fid, &treq, AFS_STATS_FS_RPCIDX_LINK,
+ (tc, rxconn, code, &adp->f.fid, &treq, AFS_STATS_FS_RPCIDX_LINK,
SHARED_LOCK, NULL));
if (code) {
struct VenusFid dotdot = {0, {0, 0, 0}};
int flagIndex = 0; /* First file with bulk fetch flag set */
int inlinebulk = 0; /* Did we use InlineBulk RPC or not? */
+ struct rx_connection *rxconn;
XSTATS_DECLS;
dotdot.Cell = 0;
dotdot.Fid.Unique = 0;
/* start the timer; callback expirations are relative to this */
startTime = osi_Time();
- tcp = afs_Conn(&adp->f.fid, areqp, SHARED_LOCK);
+ tcp = afs_Conn(&adp->f.fid, areqp, SHARED_LOCK, &rxconn);
if (tcp) {
hostp = tcp->parent->srvr->server;
retryonce:
RX_AFS_GUNLOCK();
code =
- RXAFS_InlineBulkStatus(tcp->id, &fidParm, &statParm,
+ RXAFS_InlineBulkStatus(rxconn, &fidParm, &statParm,
&cbParm, &volSync);
RX_AFS_GLOCK();
if (code == RXGEN_OPCODE) {
inlinebulk = 0;
RX_AFS_GUNLOCK();
code =
- RXAFS_BulkStatus(tcp->id, &fidParm, &statParm,
+ RXAFS_BulkStatus(rxconn, &fidParm, &statParm,
&cbParm, &volSync);
RX_AFS_GLOCK();
} else {
* Retryable errors are all whole-volume or
* whole-server.
*/
- if (afs_Analyze(tcp, (&statsp[0])->errorCode,
+ if (afs_Analyze(tcp, rxconn, (&statsp[0])->errorCode,
&adp->f.fid, areqp,
AFS_STATS_FS_RPCIDX_BULKSTATUS,
SHARED_LOCK, NULL) != 0)
inlinebulk = 0;
RX_AFS_GUNLOCK();
code =
- RXAFS_BulkStatus(tcp->id, &fidParm, &statParm, &cbParm,
+ RXAFS_BulkStatus(rxconn, &fidParm, &statParm, &cbParm,
&volSync);
RX_AFS_GLOCK();
}
} else
code = -1;
} while (afs_Analyze
- (tcp, code, &adp->f.fid, areqp, AFS_STATS_FS_RPCIDX_BULKSTATUS,
+ (tcp, rxconn, code, &adp->f.fid, areqp, AFS_STATS_FS_RPCIDX_BULKSTATUS,
SHARED_LOCK, NULL));
/* now, if we didnt get the info, bail out. */
/* If we did the InlineBulk RPC pull out the return code */
if (inlinebulk && code == 0) {
if ((&statsp[0])->errorCode) {
- afs_Analyze(tcp, (&statsp[0])->errorCode, &adp->f.fid, areqp,
+ afs_Analyze(tcp, rxconn, (&statsp[0])->errorCode, &adp->f.fid, areqp,
AFS_STATS_FS_RPCIDX_BULKSTATUS, SHARED_LOCK, NULL);
code = (&statsp[0])->errorCode;
}
struct afs_conn *tc;
struct AFSFetchStatus OutDirStatus;
struct AFSVolSync tsync;
+ struct rx_connection *rxconn;
XSTATS_DECLS;
if (!AFS_IS_DISCONNECTED) {
do {
- tc = afs_Conn(&adp->f.fid, treqp, SHARED_LOCK);
+ tc = afs_Conn(&adp->f.fid, treqp, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_REMOVEFILE);
RX_AFS_GUNLOCK();
code =
- RXAFS_RemoveFile(tc->id, (struct AFSFid *)&adp->f.fid.Fid,
+ RXAFS_RemoveFile(rxconn, (struct AFSFid *)&adp->f.fid.Fid,
aname, &OutDirStatus, &tsync);
RX_AFS_GLOCK();
XSTATS_END_TIME;
} else
code = -1;
} while (afs_Analyze
- (tc, code, &adp->f.fid, treqp, AFS_STATS_FS_RPCIDX_REMOVEFILE,
+ (tc, rxconn, code, &adp->f.fid, treqp, AFS_STATS_FS_RPCIDX_REMOVEFILE,
SHARED_LOCK, NULL));
}
struct dcache *tdc1, *tdc2;
struct AFSFetchStatus OutOldDirStatus, OutNewDirStatus;
struct AFSVolSync tsync;
+ struct rx_connection *rxconn;
XSTATS_DECLS;
AFS_STATCNT(afs_rename);
afs_Trace4(afs_iclSetp, CM_TRACE_RENAME, ICL_TYPE_POINTER, aodp,
if (!AFS_IS_DISCON_RW) {
/* Connected. */
do {
- tc = afs_Conn(&aodp->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&aodp->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_RENAME);
RX_AFS_GUNLOCK();
code =
- RXAFS_Rename(tc->id,
+ RXAFS_Rename(rxconn,
(struct AFSFid *)&aodp->f.fid.Fid,
aname1,
(struct AFSFid *)&andp->f.fid.Fid,
code = -1;
} while (afs_Analyze
- (tc, code, &andp->f.fid, areq, AFS_STATS_FS_RPCIDX_RENAME,
+ (tc, rxconn, code, &andp->f.fid, areq, AFS_STATS_FS_RPCIDX_RENAME,
SHARED_LOCK, NULL));
} else {
struct AFSVolSync tsync;
struct volume *volp = 0;
struct afs_fakestat_state fakestate;
+ struct rx_connection *rxconn;
XSTATS_DECLS;
OSI_VC_CONVERT(adp);
* the copy will be invalidated */
if (!AFS_IS_DISCON_RW) {
do {
- tc = afs_Conn(&adp->f.fid, &treq, SHARED_LOCK);
+ tc = afs_Conn(&adp->f.fid, &treq, SHARED_LOCK, &rxconn);
if (tc) {
hostp = tc->parent->srvr->server;
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_SYMLINK);
now = osi_Time();
RX_AFS_GUNLOCK();
code =
- RXAFS_DFSSymlink(tc->id,
+ RXAFS_DFSSymlink(rxconn,
(struct AFSFid *)&adp->f.fid.Fid,
aname, atargetName, &InStatus,
(struct AFSFid *)&newFid.Fid,
} else {
RX_AFS_GUNLOCK();
code =
- RXAFS_Symlink(tc->id, (struct AFSFid *)&adp->f.fid.Fid,
+ RXAFS_Symlink(rxconn, (struct AFSFid *)&adp->f.fid.Fid,
aname, atargetName, &InStatus,
(struct AFSFid *)&newFid.Fid,
&OutFidStatus, &OutDirStatus, &tsync);
} else
code = -1;
} while (afs_Analyze
- (tc, code, &adp->f.fid, &treq, AFS_STATS_FS_RPCIDX_SYMLINK,
+ (tc, rxconn, code, &adp->f.fid, &treq, AFS_STATS_FS_RPCIDX_SYMLINK,
SHARED_LOCK, NULL));
} else {
newFid.Cell = adp->f.fid.Cell;
char *bp, tbuf[CVBS]; /* biggest volume id is 2^32, ~ 4*10^9 */
unsigned int changed;
struct server *(oldhosts[NMAXNSERVERS]);
+ struct rx_connection *rxconn;
AFS_STATCNT(CheckVLDB);
afs_FinalizeReq(areq);
VSleep(2); /* Better safe than sorry. */
tconn =
afs_ConnByMHosts(tcell->cellHosts, tcell->vlport, tcell->cellNum,
- &treq, SHARED_LOCK);
+ &treq, SHARED_LOCK, &rxconn);
if (tconn) {
if ( tconn->parent->srvr->server->flags & SNO_LHOSTS) {
type = 0;
RX_AFS_GUNLOCK();
- i = VL_GetEntryByNameO(tconn->id, bp, &v->tve);
+ i = VL_GetEntryByNameO(rxconn, bp, &v->tve);
RX_AFS_GLOCK();
} else if (tconn->parent->srvr->server->flags & SYES_LHOSTS) {
type = 1;
RX_AFS_GUNLOCK();
- i = VL_GetEntryByNameN(tconn->id, bp, &v->ntve);
+ i = VL_GetEntryByNameN(rxconn, bp, &v->ntve);
RX_AFS_GLOCK();
} else {
type = 2;
RX_AFS_GUNLOCK();
- i = VL_GetEntryByNameU(tconn->id, bp, &v->utve);
+ i = VL_GetEntryByNameU(rxconn, bp, &v->utve);
RX_AFS_GLOCK();
if (!(tconn->parent->srvr->server->flags & SVLSRV_UUID)) {
if (i == RXGEN_OPCODE) {
type = 1;
RX_AFS_GUNLOCK();
- i = VL_GetEntryByNameN(tconn->id, bp, &v->ntve);
+ i = VL_GetEntryByNameN(rxconn, bp, &v->ntve);
RX_AFS_GLOCK();
if (i == RXGEN_OPCODE) {
type = 0;
tconn->parent->srvr->server->flags |= SNO_LHOSTS;
RX_AFS_GUNLOCK();
- i = VL_GetEntryByNameO(tconn->id, bp, &v->tve);
+ i = VL_GetEntryByNameO(rxconn, bp, &v->tve);
RX_AFS_GLOCK();
} else if (!i)
tconn->parent->srvr->server->flags |= SYES_LHOSTS;
}
} else
i = -1;
- } while (afs_Analyze(tconn, i, NULL, &treq, -1, /* no op code for this */
+ } while (afs_Analyze(tconn, rxconn, i, NULL, &treq, -1, /* no op code for this */
SHARED_LOCK, tcell));
afs_PutCell(tcell, READ_LOCK);
* if this is a temporary or permanent error.
*------------------------------------------------------------------------*/
int
-afs_Analyze(struct afs_conn *aconn, afs_int32 acode,
- struct VenusFid *afid, struct vrequest *areq, int op,
- afs_int32 locktype, struct cell *cellp)
+afs_Analyze(struct afs_conn *aconn, struct rx_connection *rxconn,
+ afs_int32 acode, struct VenusFid *afid, struct vrequest *areq,
+ int op, afs_int32 locktype, struct cell *cellp)
{
afs_int32 i;
struct srvAddr *sa;
if (aconn) {
/* SXW - I suspect that this will _never_ happen - we shouldn't
* get a connection because we're disconnected !!!*/
- afs_PutConn(aconn, locktype);
+ afs_PutConn(aconn, rxconn, locktype);
}
return 0;
}
}
}
- afs_PutConn(aconn, locktype);
+ afs_PutConn(aconn, rxconn, locktype);
return 0;
}
}
out:
/* now unlock the connection and return */
- afs_PutConn(aconn, locktype);
+ afs_PutConn(aconn, rxconn, locktype);
return (shouldRetry);
} /*afs_Analyze */
struct iovec *iovecp;
struct vrequest *areq;
afs_int32 code = 0;
+ struct rx_connection *rxconn;
#ifdef AFS_64BIT_CLIENT
afs_int32 length_hi, bytes, locked;
#endif
tcallspec = (struct tlocal1 *) osi_Alloc(sizeof(struct tlocal1));
do {
- tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK /* ignored */);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK /* ignored */, &rxconn);
if (tc) {
avc->callback = tc->parent->srvr->server;
- tcall = rx_NewCall(tc->id);
+ tcall = rx_NewCall(rxconn);
#ifdef AFS_64BIT_CLIENT
if (!afs_serverHasNo64Bit(tc)) {
code = StartRXAFS_FetchData64(tcall,
pos = auio->uio_offset;
COND_GUNLOCK(locked);
if (!tcall)
- tcall = rx_NewCall(tc->id);
+ tcall = rx_NewCall(rxconn);
code = StartRXAFS_FetchData(tcall,
(struct AFSFid *) &avc->f.fid.Fid,
pos, bparms->length);
unlock_and_release_pages(auio);
goto done;
}
- } while (afs_Analyze(tc, code, &avc->f.fid, areq,
+ } while (afs_Analyze(tc, rxconn, code, &avc->f.fid, areq,
AFS_STATS_FS_RPCIDX_FETCHDATA,
SHARED_LOCK,0));
done:
*/
struct afs_conn *
afs_Conn(struct VenusFid *afid, struct vrequest *areq,
- afs_int32 locktype)
+ afs_int32 locktype, struct rx_connection **rxconn)
{
u_short fsport = AFS_FSPORT;
struct volume *tv;
int i;
struct srvAddr *sa1p;
+ *rxconn = NULL;
+
AFS_STATCNT(afs_Conn);
/* Get fid's volume. */
tv = afs_GetVolume(afid, areq, READ_LOCK);
if (lowp) {
tu = afs_GetUser(areq->uid, afid->Cell, SHARED_LOCK);
tconn = afs_ConnBySA(lowp, fsport, afid->Cell, tu, 0 /*!force */ ,
- 1 /*create */ , locktype);
+ 1 /*create */ , locktype, rxconn);
afs_PutUser(tu, SHARED_LOCK);
}
struct afs_conn *
afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell,
struct unixuser *tu, int force_if_down, afs_int32 create,
- afs_int32 locktype)
+ afs_int32 locktype, struct rx_connection **rxconn)
{
int glocked, foundvec;
struct afs_conn *tc = NULL;
int isec; /*Security index */
int service;
+ *rxconn = NULL;
+
/* find cached connection */
ObtainSharedLock(&afs_xconn, 15);
foundvec = 0;
ConvertWToSLock(&afs_xconn);
} /* end of if (tc->forceConnectFS)*/
+ *rxconn = tc->id;
+ rx_GetConnection(*rxconn);
+
ReleaseSharedLock(&afs_xconn);
return tc;
}
*/
struct afs_conn *
afs_ConnByHost(struct server *aserver, unsigned short aport, afs_int32 acell,
- struct vrequest *areq, int aforce, afs_int32 locktype)
+ struct vrequest *areq, int aforce, afs_int32 locktype,
+ struct rx_connection **rxconn)
{
struct unixuser *tu;
struct afs_conn *tc = NULL;
struct srvAddr *sa = NULL;
+ *rxconn = NULL;
+
AFS_STATCNT(afs_ConnByHost);
if (AFS_IS_DISCONNECTED && !AFS_IN_SYNC) {
for (sa = aserver->addr; sa; sa = sa->next_sa) {
tc = afs_ConnBySA(sa, aport, acell, tu, aforce,
0 /*don't create one */ ,
- locktype);
+ locktype, rxconn);
if (tc)
break;
}
for (sa = aserver->addr; sa; sa = sa->next_sa) {
tc = afs_ConnBySA(sa, aport, acell, tu, aforce,
1 /*create one */ ,
- locktype);
+ locktype, rxconn);
if (tc)
break;
}
struct afs_conn *
afs_ConnByMHosts(struct server *ahosts[], unsigned short aport,
afs_int32 acell, struct vrequest *areq,
- afs_int32 locktype)
+ afs_int32 locktype, struct rx_connection **rxconn)
{
afs_int32 i;
struct afs_conn *tconn;
struct server *ts;
+ *rxconn = NULL;
+
/* try to find any connection from the set */
AFS_STATCNT(afs_ConnByMHosts);
for (i = 0; i < AFS_MAXCELLHOSTS; i++) {
if ((ts = ahosts[i]) == NULL)
break;
- tconn = afs_ConnByHost(ts, aport, acell, areq, 0, locktype);
+ tconn = afs_ConnByHost(ts, aport, acell, areq, 0, locktype, rxconn);
if (tconn) {
return tconn;
}
* @param locktype
*/
void
-afs_PutConn(struct afs_conn *ac, afs_int32 locktype)
+afs_PutConn(struct afs_conn *ac, struct rx_connection *rxconn,
+ afs_int32 locktype)
{
AFS_STATCNT(afs_PutConn);
ac->refCount--;
ac->parent->refCount--;
+ rx_PutConnection(rxconn);
} /*afs_PutConn */
int doAdjustSize = 0;
int doReallyAdjustSize = 0;
int overWriteWholeChunk = 0;
+ struct rx_connection *rxconn;
#ifndef AFS_NOSTATS
struct afs_stats_AccessInfo *accP; /*Ptr to access record in stats */
* tdc->lock(W)
*/
- tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
#ifndef AFS_NOSTATS
numFetchLoops++;
setNewCallback = 1;
}
i = osi_Time();
- code = afs_CacheFetchProc(tc, file, Position, tdc,
+ code = afs_CacheFetchProc(tc, rxconn, file, Position, tdc,
avc, size, tsmall);
} else
code = -1;
}
} while (afs_Analyze
- (tc, code, &avc->f.fid, areq,
+ (tc, rxconn, code, &avc->f.fid, areq,
AFS_STATS_FS_RPCIDX_FETCHDATA, SHARED_LOCK, NULL));
/*
struct AFSFetchStatus OutOldDirStatus, OutNewDirStatus;
struct AFSVolSync tsync;
struct afs_conn *tc;
+ struct rx_connection *rxconn;
afs_uint32 code = 0;
XSTATS_DECLS;
/* Send to data to server. */
do {
- tc = afs_Conn(&old_pdir_fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&old_pdir_fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_RENAME);
RX_AFS_GUNLOCK();
- code = RXAFS_Rename(tc->id,
+ code = RXAFS_Rename(rxconn,
(struct AFSFid *)&old_pdir_fid.Fid,
old_name,
(struct AFSFid *)&new_pdir_fid.Fid,
code = -1;
} while (afs_Analyze(tc,
+ rxconn,
code,
&new_pdir_fid,
areq,
struct vcache *tdp = NULL, *tvc = NULL;
struct dcache *tdc = NULL;
struct afs_conn *tc;
+ struct rx_connection *rxconn;
afs_int32 hash, new_hash, index;
afs_size_t tlen;
int code, op = 0;
InStatus.UnixModeBits = avc->f.m.Mode & 0xffff;
do {
- tc = afs_Conn(&tdp->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&tdp->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
switch (vType(avc)) {
case VREG:
op = AFS_STATS_FS_RPCIDX_CREATEFILE;
XSTATS_START_TIME(op);
RX_AFS_GUNLOCK();
- code = RXAFS_CreateFile(tc->id,
+ code = RXAFS_CreateFile(rxconn,
(struct AFSFid *)&tdp->f.fid.Fid,
tname, &InStatus,
(struct AFSFid *) &newFid.Fid,
op = AFS_STATS_FS_RPCIDX_MAKEDIR;
XSTATS_START_TIME(op);
RX_AFS_GUNLOCK();
- code = RXAFS_MakeDir(tc->id, (struct AFSFid *) &tdp->f.fid.Fid,
+ code = RXAFS_MakeDir(rxconn, (struct AFSFid *) &tdp->f.fid.Fid,
tname, &InStatus,
(struct AFSFid *) &newFid.Fid,
&OutFidStatus, &OutDirStatus,
op = AFS_STATS_FS_RPCIDX_SYMLINK;
XSTATS_START_TIME(op);
RX_AFS_GUNLOCK();
- code = RXAFS_Symlink(tc->id,
+ code = RXAFS_Symlink(rxconn,
(struct AFSFid *) &tdp->f.fid.Fid,
tname, ttargetName, &InStatus,
(struct AFSFid *) &newFid.Fid,
}
} else
code = -1;
- } while (afs_Analyze(tc, code, &tdp->f.fid, areq, op, SHARED_LOCK, NULL));
+ } while (afs_Analyze(tc, rxconn, code, &tdp->f.fid, areq, op, SHARED_LOCK, NULL));
/* TODO: Handle errors. */
if (code) {
struct VenusFid pdir_fid;
struct AFSVolSync tsync;
struct afs_conn *tc;
+ struct rx_connection *rxconn;
struct vcache *tdp = NULL;
int code = 0;
XSTATS_DECLS;
if (vType(avc) == VREG || vType(avc) == VLNK) {
/* Remove file on server. */
do {
- tc = afs_Conn(&pdir_fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&pdir_fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_REMOVEFILE);
RX_AFS_GUNLOCK();
- code = RXAFS_RemoveFile(tc->id,
+ code = RXAFS_RemoveFile(rxconn,
&pdir_fid.Fid,
tname,
&OutDirStatus,
} else
code = -1;
} while (afs_Analyze(tc,
+ rxconn,
code,
&pdir_fid,
areq,
} else if (vType(avc) == VDIR) {
/* Remove dir on server. */
do {
- tc = afs_Conn(&pdir_fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&pdir_fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_REMOVEDIR);
RX_AFS_GUNLOCK();
- code = RXAFS_RemoveDir(tc->id,
+ code = RXAFS_RemoveDir(rxconn,
&pdir_fid.Fid,
tname,
&OutDirStatus,
} else
code = -1;
} while (afs_Analyze(tc,
+ rxconn,
code,
&pdir_fid,
areq,
afs_SendChanges(struct vcache *avc, struct vrequest *areq)
{
struct afs_conn *tc;
+ struct rx_connection *rxconn;
struct AFSStoreStatus sstat;
struct AFSFetchStatus fstat;
struct AFSVolSync tsync;
/* Turn dirty vc data into a new store status... */
if (afs_GenStoreStatus(avc, &sstat) > 0) {
do {
- tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
/* ... and send it. */
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STORESTATUS);
RX_AFS_GUNLOCK();
- code = RXAFS_StoreStatus(tc->id,
+ code = RXAFS_StoreStatus(rxconn,
(struct AFSFid *) &avc->f.fid.Fid,
&sstat,
&fstat,
code = -1;
} while (afs_Analyze(tc,
+ rxconn,
code,
&avc->f.fid,
areq,
/* Truncate OP: */
do {
- tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
/* Set storing flags. XXX: A tad inefficient ... */
if (avc->f.ddirty_flags & VDisconWriteClose)
code = -1;
} while (afs_Analyze(tc,
+ rxconn,
code,
&avc->f.fid,
areq,
afs_ResyncDisconFiles(struct vrequest *areq, afs_ucred_t *acred)
{
struct afs_conn *tc;
+ struct rx_connection *rxconn;
struct vcache *tvc;
struct AFSFetchStatus fstat;
struct AFSCallBack callback;
#if 0
/* Get server write lock. */
do {
- tc = afs_Conn(&tvc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&tvc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_SETLOCK);
RX_AFS_GUNLOCK();
- code = RXAFS_SetLock(tc->id,
+ code = RXAFS_SetLock(rxconn,
(struct AFSFid *)&tvc->f.fid.Fid,
LockWrite,
&tsync);
code = -1;
} while (afs_Analyze(tc,
+ rxconn,
code,
&tvc->f.fid,
areq,
/* Issue a FetchStatus to get info about DV and callbacks. */
do {
- tc = afs_Conn(&tvc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&tvc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
tvc->callback = tc->parent->srvr->server;
start = osi_Time();
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHSTATUS);
RX_AFS_GUNLOCK();
- code = RXAFS_FetchStatus(tc->id,
+ code = RXAFS_FetchStatus(rxconn,
(struct AFSFid *)&tvc->f.fid.Fid,
&fstat,
&callback,
code = -1;
} while (afs_Analyze(tc,
+ rxconn,
code,
&tvc->f.fid,
areq,
/* Release server write lock. */
#if 0
do {
- tc = afs_Conn(&tvc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&tvc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_RELEASELOCK);
RX_AFS_GUNLOCK();
- ucode = RXAFS_ReleaseLock(tc->id,
+ ucode = RXAFS_ReleaseLock(rxconn,
(struct AFSFid *) &tvc->f.fid.Fid,
&tsync);
RX_AFS_GLOCK();
} else
ucode = -1;
} while (afs_Analyze(tc,
+ rxconn,
ucode,
&tvc->f.fid,
areq,
};
afs_int32
-rxfs_storeInit(struct vcache *avc, struct afs_conn *tc, afs_size_t base,
+rxfs_storeInit(struct vcache *avc, struct afs_conn *tc,
+ struct rx_connection *rxconn, afs_size_t base,
afs_size_t bytes, afs_size_t length,
int sync, struct storeOps **ops, void **rock)
{
if (sync & AFS_SYNC)
v->InStatus.Mask |= AFS_FSYNC;
RX_AFS_GUNLOCK();
- v->call = rx_NewCall(tc->id);
+ v->call = rx_NewCall(rxconn);
if (v->call) {
#ifdef AFS_64BIT_CLIENT
if (!afs_serverHasNo64Bit(tc))
int nomore;
unsigned int first = 0;
struct afs_conn *tc;
+ struct rx_connection *rxconn;
for (bytes = 0, j = 0; !code && j <= high; j++) {
if (dcList[j]) {
ICL_HANDLE_OFFSET(length));
do {
- tc = afs_Conn(&avc->f.fid, areq, 0);
+ tc = afs_Conn(&avc->f.fid, areq, 0, &rxconn);
#ifdef AFS_64BIT_CLIENT
restart:
#endif
- code = rxfs_storeInit(avc, tc, base, bytes, length,
+ code = rxfs_storeInit(avc, tc, rxconn, base, bytes, length,
sync, &ops, &rock);
if ( !code ) {
code = afs_CacheStoreDCaches(avc, dclist, bytes, anewDV,
}
#endif /* AFS_64BIT_CLIENT */
} while (afs_Analyze
- (tc, code, &avc->f.fid, areq,
+ (tc, rxconn, code, &avc->f.fid, areq,
AFS_STATS_FS_RPCIDX_STOREDATA, SHARED_LOCK,
NULL));
};
afs_int32
-rxfs_fetchInit(struct afs_conn *tc, struct vcache *avc, afs_offs_t base,
+rxfs_fetchInit(struct afs_conn *tc, struct rx_connection *rxconn,
+ struct vcache *avc, afs_offs_t base,
afs_uint32 size, afs_int32 *alength, struct dcache *adc,
struct osi_file *fP, struct fetchOps **ops, void **rock)
{
memset(v, 0, sizeof(struct rxfs_fetchVariables));
RX_AFS_GUNLOCK();
- v->call = rx_NewCall(tc->id);
+ v->call = rx_NewCall(rxconn);
RX_AFS_GLOCK();
if (v->call) {
#ifdef AFS_64BIT_CLIENT
pos = base;
RX_AFS_GUNLOCK();
if (!v->call)
- v->call = rx_NewCall(tc->id);
+ v->call = rx_NewCall(rxconn);
code =
StartRXAFS_FetchData(
v->call, (struct AFSFid*)&avc->f.fid.Fid,
* Routine called on fetch; also tells people waiting for data
* that more has arrived.
*
- * \param tc Ptr to the Rx connection structure.
+ * \param tc Ptr to the AFS connection structure.
+ * \param rxconn Ptr to the Rx connection structure.
* \param fP File descriptor for the cache file.
* \param base Base offset to fetch.
* \param adc Ptr to the dcache entry for the file, write-locked.
* \note Environment: Nothing interesting.
*/
int
-afs_CacheFetchProc(struct afs_conn *tc, struct osi_file *fP, afs_size_t base,
+afs_CacheFetchProc(struct afs_conn *tc, struct rx_connection *rxconn,
+ struct osi_file *fP, afs_size_t base,
struct dcache *adc, struct vcache *avc, afs_int32 size,
struct afs_FetchOutput *tsmall)
{
* adc->lock(W)
*/
code = rxfs_fetchInit(
- tc, avc, base, size, &length, adc, fP, &ops, &rock);
+ tc, rxconn, avc, base, size, &length, adc, fP, &ops, &rock);
#ifndef AFS_NOSTATS
osi_GetuTime(&xferStartTime);
struct AFSOpaque acl;
struct AFSVolSync tsync;
struct AFSFetchStatus OutStatus;
+ struct rx_connection *rxconn;
XSTATS_DECLS;
AFS_STATCNT(PSetAcl);
return EINVAL;
do {
- tconn = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tconn = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tconn) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STOREACL);
RX_AFS_GUNLOCK();
code =
- RXAFS_StoreACL(tconn->id, (struct AFSFid *)&avc->f.fid.Fid,
+ RXAFS_StoreACL(rxconn, (struct AFSFid *)&avc->f.fid.Fid,
&acl, &OutStatus, &tsync);
RX_AFS_GLOCK();
XSTATS_END_TIME;
} else
code = -1;
} while (afs_Analyze
- (tconn, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_STOREACL,
+ (tconn, rxconn, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_STOREACL,
SHARED_LOCK, NULL));
/* now we've forgotten all of the access info */
afs_int32 code;
struct afs_conn *tconn;
struct AFSFid Fid;
+ struct rx_connection *rxconn;
XSTATS_DECLS;
AFS_STATCNT(PGetAcl);
}
acl.AFSOpaque_val = aout->ptr;
do {
- tconn = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tconn = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tconn) {
acl.AFSOpaque_val[0] = '\0';
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHACL);
RX_AFS_GUNLOCK();
- code = RXAFS_FetchACL(tconn->id, &Fid, &acl, &OutStatus, &tsync);
+ code = RXAFS_FetchACL(rxconn, &Fid, &acl, &OutStatus, &tsync);
RX_AFS_GLOCK();
XSTATS_END_TIME;
} else
code = -1;
} while (afs_Analyze
- (tconn, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_FETCHACL,
+ (tconn, rxconn, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_FETCHACL,
SHARED_LOCK, NULL));
if (code == 0) {
afs_int32 code = 0;
struct AFSFetchVolumeStatus volstat;
char *Name;
+ struct rx_connection *rxconn;
XSTATS_DECLS;
osi_Assert(offLineMsg != NULL);
}
Name = volName;
do {
- tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GETVOLUMESTATUS);
RX_AFS_GUNLOCK();
code =
- RXAFS_GetVolumeStatus(tc->id, avc->f.fid.Fid.Volume, &volstat,
+ RXAFS_GetVolumeStatus(rxconn, avc->f.fid.Fid.Volume, &volstat,
&Name, &offLineMsg, &motd);
RX_AFS_GLOCK();
XSTATS_END_TIME;
} else
code = -1;
} while (afs_Analyze
- (tc, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_GETVOLUMESTATUS,
+ (tc, rxconn, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_GETVOLUMESTATUS,
SHARED_LOCK, NULL));
if (code)
struct AFSFetchVolumeStatus volstat;
struct AFSStoreVolumeStatus storeStat;
struct volume *tvp;
+ struct rx_connection *rxconn;
XSTATS_DECLS;
AFS_STATCNT(PSetVolumeStatus);
storeStat.Mask |= AFS_SETMAXQUOTA;
}
do {
- tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_SETVOLUMESTATUS);
RX_AFS_GUNLOCK();
code =
- RXAFS_SetVolumeStatus(tc->id, avc->f.fid.Fid.Volume, &storeStat,
+ RXAFS_SetVolumeStatus(rxconn, avc->f.fid.Fid.Volume, &storeStat,
volName, offLineMsg, motd);
RX_AFS_GLOCK();
XSTATS_END_TIME;
} else
code = -1;
} while (afs_Analyze
- (tc, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_SETVOLUMESTATUS,
+ (tc, rxconn, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_SETVOLUMESTATUS,
SHARED_LOCK, NULL));
if (code)
struct AFSCallBack CallBacks_Array[1];
struct AFSCBFids theFids;
struct AFSCBs theCBs;
+ struct rx_connection *rxconn;
XSTATS_DECLS;
AFS_STATCNT(PRemoveCallBack);
CallBacks_Array[0].CallBackType = CB_DROPPED;
if (avc->callback) {
do {
- tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS);
RX_AFS_GUNLOCK();
- code = RXAFS_GiveUpCallBacks(tc->id, &theFids, &theCBs);
+ code = RXAFS_GiveUpCallBacks(rxconn, &theFids, &theCBs);
RX_AFS_GLOCK();
XSTATS_END_TIME;
}
/* don't set code on failure since we wouldn't use it */
} while (afs_Analyze
- (tc, code, &avc->f.fid, areq,
+ (tc, rxconn, code, &avc->f.fid, areq,
AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS, SHARED_LOCK, NULL));
ObtainWriteLock(&afs_xcbhash, 457);
struct AFSFetchStatus OutDirStatus;
struct VenusFid tfid;
struct AFSVolSync tsync;
+ struct rx_connection *rxconn;
XSTATS_DECLS;
/* "ain" is the name of the file in this dir to remove */
ObtainWriteLock(&avc->lock, 231);
osi_dnlc_remove(avc, bufp, tvc);
do {
- tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_REMOVEFILE);
RX_AFS_GUNLOCK();
code =
- RXAFS_RemoveFile(tc->id, (struct AFSFid *)&avc->f.fid.Fid, bufp,
+ RXAFS_RemoveFile(rxconn, (struct AFSFid *)&avc->f.fid.Fid, bufp,
&OutDirStatus, &tsync);
RX_AFS_GLOCK();
XSTATS_END_TIME;
} else
code = -1;
} while (afs_Analyze
- (tc, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_REMOVEFILE,
+ (tc, rxconn, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_REMOVEFILE,
SHARED_LOCK, NULL));
if (code) {
struct VenusFid tfid;
struct AFSFid *Fid;
struct vcache *tvc;
+ struct rx_connection *rxconn;
AFS_STATCNT(PSetAcl);
if (!avc)
ICL_TYPE_FID, &tfid, ICL_TYPE_FID, &tvc->f.fid);
do {
- tc = afs_Conn(&tvc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&tvc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
RX_AFS_GUNLOCK();
- tcall = rx_NewCall(tc->id);
+ tcall = rx_NewCall(rxconn);
code =
StartRXAFS_FetchData(tcall, (struct AFSFid *)&tvc->f.fid.Fid, 0,
0);
} else
code = -1;
} while (afs_Analyze
- (tc, code, &tvc->f.fid, areq, AFS_STATS_FS_RPCIDX_RESIDENCYRPCS,
+ (tc, rxconn, code, &tvc->f.fid, areq, AFS_STATS_FS_RPCIDX_RESIDENCYRPCS,
SHARED_LOCK, NULL));
/* This call is done only to have the callback things handled correctly */
afs_FetchStatus(tvc, &tfid, areq, &OutStatus);
struct FsCmdOutputs *Outputs;
struct VenusFid tfid;
struct AFSFid *Fid;
+ struct rx_connection *rxconn;
if (!avc)
return EINVAL;
if (Inputs->command) {
do {
- tc = afs_Conn(&tvc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&tvc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
RX_AFS_GUNLOCK();
code =
- RXAFS_FsCmd(tc->id, Fid, Inputs,
+ RXAFS_FsCmd(rxconn, Fid, Inputs,
(struct FsCmdOutputs *)aout);
RX_AFS_GLOCK();
} else
code = -1;
} while (afs_Analyze
- (tc, code, &tvc->f.fid, areq,
+ (tc, rxconn, code, &tvc->f.fid, areq,
AFS_STATS_FS_RPCIDX_RESIDENCYRPCS, SHARED_LOCK, NULL));
/* This call is done to have the callback things handled correctly */
afs_FetchStatus(tvc, &tfid, areq, &Outputs->status);
afs_int32 i, j;
struct unixuser *tu;
struct srvAddr **addrs;
+ struct rx_connection *rxconn;
/*AFS_STATCNT(PCallBackAddr); */
if (!afs_resourceinit_flag) /* afs deamons havn't started yet */
/* get a connection, even if host is down; bumps conn ref count */
tu = afs_GetUser(areq->uid, ts->cell->cellNum, SHARED_LOCK);
tc = afs_ConnBySA(sa, ts->cell->fsport, ts->cell->cellNum, tu,
- 1 /*force */ , 1 /*create */ , SHARED_LOCK);
+ 1 /*force */ , 1 /*create */ , SHARED_LOCK, &rxconn);
afs_PutUser(tu, SHARED_LOCK);
if (!tc)
continue;
if ((sa->sa_flags & SRVADDR_ISDOWN) || afs_HaveCallBacksFrom(ts)) {
if (sa->sa_flags & SRVADDR_ISDOWN) {
- rx_SetConnDeadTime(tc->id, 3);
+ rx_SetConnDeadTime(rxconn, 3);
}
#ifdef RX_ENABLE_LOCKS
AFS_GUNLOCK();
#endif /* RX_ENABLE_LOCKS */
- code = RXAFS_CallBackRxConnAddr(tc->id, &addr);
+ code = RXAFS_CallBackRxConnAddr(rxconn, &addr);
#ifdef RX_ENABLE_LOCKS
AFS_GLOCK();
#endif /* RX_ENABLE_LOCKS */
}
- afs_PutConn(tc, SHARED_LOCK); /* done with it now */
+ afs_PutConn(tc, rxconn, SHARED_LOCK); /* done with it now */
} /* Outer loop over addrs */
#endif /* UKERNEL */
return 0;
#define _AFS_PROTOTYPES_H_
/* afs_analyze.c */
-extern int afs_Analyze(struct afs_conn *aconn, afs_int32 acode,
- struct VenusFid *afid, struct vrequest *areq,
+extern int afs_Analyze(struct afs_conn *aconn, struct rx_connection *rxconn,
+ afs_int32 acode, struct VenusFid *afid,
+ struct vrequest *areq,
int op, afs_int32 locktype, struct cell *cellp);
/* afs_axscache.c */
extern afs_rwlock_t afs_xconn;
extern struct afs_conn *afs_Conn(struct VenusFid *afid,
struct vrequest *areq,
- afs_int32 locktype);
+ afs_int32 locktype,
+ struct rx_connection **rxconn);
extern struct afs_conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport,
afs_int32 acell, struct unixuser *tu,
int force_if_down, afs_int32 create,
- afs_int32 locktype);
+ afs_int32 locktype,
+ struct rx_connection **rxconn);
extern struct afs_conn *afs_ConnByMHosts(struct server *ahosts[],
unsigned short aport, afs_int32 acell,
struct vrequest *areq,
- afs_int32 locktype);
+ afs_int32 locktype,
+ struct rx_connection **rxconn);
extern struct afs_conn *afs_ConnByHost(struct server *aserver,
unsigned short aport, afs_int32 acell,
struct vrequest *areq, int aforce,
- afs_int32 locktype);
-extern void afs_PutConn(struct afs_conn *ac, afs_int32 locktype);
+ afs_int32 locktype,
+ struct rx_connection **rxconn);
+extern void afs_PutConn(struct afs_conn *ac, struct rx_connection *rxconn,
+ afs_int32 locktype);
extern void afs_ReleaseConns(struct sa_conn_vector *tcv);
extern void afs_ReleaseConnsUser(register struct unixuser *au);
extern void ForceNewConnections(struct srvAddr *sap);
unsigned int high, unsigned int moredata,
afs_hyper_t *anewDV,
afs_size_t *amaxStoredLength);
-extern int afs_CacheFetchProc(struct afs_conn *tc, struct osi_file *fP,
+extern int afs_CacheFetchProc(struct afs_conn *tc, struct rx_connection *rxconn,
+ struct osi_file *fP,
afs_size_t abase, struct dcache *adc,
struct vcache *avc, afs_int32 size,
struct afs_FetchOutput *tsmall);
struct AFSVolSync tsync;
afs_int32 code;
struct rx_call *tcall;
+ struct rx_connection *rxconn;
afs_size_t tlen, xlen = 0;
XSTATS_DECLS;
AFS_STATCNT(afs_StoreMini);
avc->f.states &= ~CExtendedFile;
do {
- tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
#ifdef AFS_64BIT_CLIENT
retry:
#endif
RX_AFS_GUNLOCK();
- tcall = rx_NewCall(tc->id);
+ tcall = rx_NewCall(rxconn);
RX_AFS_GLOCK();
/* Set the client mod time since we always want the file
* to have the client's mod time and not the server's one
} else
code = -1;
} while (afs_Analyze
- (tc, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_STOREDATA,
+ (tc, rxconn, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_STOREDATA,
SHARED_LOCK, NULL));
if (code == 0)
struct server *aserver = sa->server;
struct afs_conn *tc;
afs_int32 code;
+ struct rx_connection *rxconn;
AFS_STATCNT(CheckVLServer);
/* Ping dead servers to see if they're back */
return; /* can't do much */
tc = afs_ConnByHost(aserver, aserver->cell->vlport,
- aserver->cell->cellNum, areq, 1, SHARED_LOCK);
+ aserver->cell->cellNum, areq, 1, SHARED_LOCK, &rxconn);
if (!tc)
return;
- rx_SetConnDeadTime(tc->id, 3);
+ rx_SetConnDeadTime(rxconn, 3);
RX_AFS_GUNLOCK();
- code = VL_ProbeServer(tc->id);
+ code = VL_ProbeServer(rxconn);
RX_AFS_GLOCK();
- rx_SetConnDeadTime(tc->id, afs_rx_deadtime);
- afs_PutConn(tc, SHARED_LOCK);
+ rx_SetConnDeadTime(rxconn, afs_rx_deadtime);
+ afs_PutConn(tc, rxconn, SHARED_LOCK);
/*
* If probe worked, or probe call not yet defined (for compatibility
* with old vlsevers), then we treat this server as running again
tc = conns[multi_i];
sa = tc->parent->srvr;
if (conntimer[multi_i] == 1)
- rx_SetConnDeadTime(tc->id, afs_rx_deadtime);
+ rx_SetConnDeadTime(rxconns[multi_i], afs_rx_deadtime);
end = osi_Time();
results[multi_i]=multi_error;
if ((start == end) && !multi_error)
osi_Assert(results != NULL);
for (i = 0; i < j; i++) {
+ struct rx_connection *rxconn;
sa = addrs[i];
ts = sa->server;
if (!ts)
/* get a connection, even if host is down; bumps conn ref count */
tu = afs_GetUser(treq.uid, ts->cell->cellNum, SHARED_LOCK);
tc = afs_ConnBySA(sa, ts->cell->fsport, ts->cell->cellNum, tu,
- 1 /*force */ , 1 /*create */ , SHARED_LOCK);
+ 1 /*force */ , 1 /*create */ , SHARED_LOCK, &rxconn);
afs_PutUser(tu, SHARED_LOCK);
if (!tc)
continue;
if ((sa->sa_flags & SRVADDR_ISDOWN) || afs_HaveCallBacksFrom(sa->server)
|| (tc->parent->srvr->server == afs_setTimeHost)) {
conns[nconns]=tc;
- rxconns[nconns]=tc->id;
+ rxconns[nconns]=rxconn;
if (sa->sa_flags & SRVADDR_ISDOWN) {
- rx_SetConnDeadTime(tc->id, 3);
+ rx_SetConnDeadTime(rxconn, 3);
conntimer[nconns]=1;
} else {
conntimer[nconns]=0;
for (i = 0; i < nconns; i++) {
if (conntimer[i] == 1)
- rx_SetConnDeadTime(tc->id, afs_rx_deadtime);
- afs_PutConn(conns[i], SHARED_LOCK); /* done with it now */
+ rx_SetConnDeadTime(rxconns[i], afs_rx_deadtime);
+ afs_PutConn(conns[i], rxconns[i], SHARED_LOCK); /* done with it now */
}
afs_osi_Free(addrs, srvAddrCount * sizeof(*addrs));
struct vrequest treq;
struct afs_conn *tc;
struct unixuser *tu;
+ struct rx_connection *rxconn;
afs_int32 code;
if ( !ts || !ts->cell )
if ( !tu )
return;
tc = afs_ConnBySA(ts->addr, ts->cell->fsport, ts->cell->cellNum, tu, 0, 1,
- SHARED_LOCK);
+ SHARED_LOCK,
+ &rxconn);
if ( !tc )
return;
/* InitCallBackStateN, triggered by our RPC, may need this */
ReleaseWriteLock(&afs_xserver);
- code = RXAFS_GetCapabilities(tc->id, &caps);
+ code = RXAFS_GetCapabilities(rxconn, &caps);
ObtainWriteLock(&afs_xserver, 723);
/* we forced a conn above; important we mark it down if needed */
if ((code < 0) && (code != RXGEN_OPCODE)) {
afs_ServerDown(tc->parent->srvr);
ForceNewConnections(tc->parent->srvr); /* multi homed clients */
}
- afs_PutConn(tc, SHARED_LOCK);
+ afs_PutConn(tc, rxconn, SHARED_LOCK);
if ( code && code != RXGEN_OPCODE ) {
afs_warn("RXAFS_GetCapabilities failed with code %d\n", code);
/* better not be anything to free. we failed! */
tcount = 0; /* number found so far */
for (safety2 = 0; safety2 < afs_cacheStats; safety2++) {
if (tcount >= AFS_MAXCBRSCALL || !tsp->cbrs) {
+ struct rx_connection *rxconn;
/* if buffer is full, or we've queued all we're going
* to from this server, we should flush out the
* callbacks.
for (safety3 = 0; safety3 < AFS_MAXHOSTS * 2; safety3++) {
tc = afs_ConnByHost(tsp, tsp->cell->fsport,
tsp->cell->cellNum, &treq, 0,
- SHARED_LOCK);
+ SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME
(AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS);
RX_AFS_GUNLOCK();
code =
- RXAFS_GiveUpCallBacks(tc->id, &fidArray,
+ RXAFS_GiveUpCallBacks(rxconn, &fidArray,
&cbArray);
RX_AFS_GLOCK();
XSTATS_END_TIME;
} else
code = -1;
if (!afs_Analyze
- (tc, code, 0, &treq,
+ (tc, rxconn, code, 0, &treq,
AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS, SHARED_LOCK,
tsp->cell)) {
break;
tvc->flockCount)) panic("Dead vnode has core/unlinkedel/flock");
#endif
if (doflocks && tvc->flockCount != 0) {
+ struct rx_connection *rxconn;
/* if this entry has an flock, send a keep-alive call out */
osi_vnhold(tvc, 0);
ReleaseReadLock(&afs_xvcache);
afs_InitReq(&treq, afs_osi_credp);
treq.flags |= O_NONBLOCK;
- tc = afs_Conn(&tvc->f.fid, &treq, SHARED_LOCK);
+ tc = afs_Conn(&tvc->f.fid, &treq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_EXTENDLOCK);
RX_AFS_GUNLOCK();
code =
- RXAFS_ExtendLock(tc->id,
+ RXAFS_ExtendLock(rxconn,
(struct AFSFid *)&tvc->f.fid.Fid,
&tsync);
RX_AFS_GLOCK();
} else
code = -1;
} while (afs_Analyze
- (tc, code, &tvc->f.fid, &treq,
+ (tc, rxconn, code, &tvc->f.fid, &treq,
AFS_STATS_FS_RPCIDX_EXTENDLOCK, SHARED_LOCK, NULL));
ReleaseWriteLock(&tvc->lock);
struct afs_conn *tc;
struct AFSFetchStatus OutStatus;
struct AFSVolSync tsync;
+ struct rx_connection *rxconn;
XSTATS_DECLS;
AFS_STATCNT(afs_WriteVCache);
afs_Trace2(afs_iclSetp, CM_TRACE_WVCACHE, ICL_TYPE_POINTER, avc,
ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->f.m.Length));
do {
- tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK, &rxconn);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STORESTATUS);
RX_AFS_GUNLOCK();
code =
- RXAFS_StoreStatus(tc->id, (struct AFSFid *)&avc->f.fid.Fid,
+ RXAFS_StoreStatus(rxconn, (struct AFSFid *)&avc->f.fid.Fid,
astatus, &OutStatus, &tsync);
RX_AFS_GLOCK();
XSTATS_END_TIME;
} else
code = -1;
} while (afs_Analyze
- (tc, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_STORESTATUS,
+ (tc, rxconn, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_STORESTATUS,
SHARED_LOCK, NULL));
UpgradeSToWLock(&avc->lock, 20);
{
afs_int32 code;
struct afs_conn *tc;
+ struct rx_connection *rxconn;
struct AFSFetchStatus OutDirStatus;
XSTATS_DECLS;
if (!name)
name = ""; /* XXX */
do {
- tc = afs_Conn(afid, areq, SHARED_LOCK);
+ tc = afs_Conn(afid, areq, SHARED_LOCK, &rxconn);
if (tc) {
if (serverp)
*serverp = tc->parent->srvr->server;
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_XLOOKUP);
RX_AFS_GUNLOCK();
code =
- RXAFS_Lookup(tc->id, (struct AFSFid *)&afid->Fid, name,
+ RXAFS_Lookup(rxconn, (struct AFSFid *)&afid->Fid, name,
(struct AFSFid *)&nfid->Fid, OutStatusp,
&OutDirStatus, CallBackp, tsyncp);
RX_AFS_GLOCK();
} else
code = -1;
} while (afs_Analyze
- (tc, code, afid, areq, AFS_STATS_FS_RPCIDX_XLOOKUP, SHARED_LOCK,
+ (tc, rxconn, code, afid, areq, AFS_STATS_FS_RPCIDX_XLOOKUP, SHARED_LOCK,
NULL));
return code;
struct afs_conn *tc;
struct AFSCallBack CallBack;
struct AFSVolSync tsync;
+ struct rx_connection *rxconn;
XSTATS_DECLS;
do {
- tc = afs_Conn(afid, areq, SHARED_LOCK);
+ tc = afs_Conn(afid, areq, SHARED_LOCK, &rxconn);
avc->dchint = NULL; /* invalidate hints */
if (tc) {
avc->callback = tc->parent->srvr->server;
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHSTATUS);
RX_AFS_GUNLOCK();
code =
- RXAFS_FetchStatus(tc->id, (struct AFSFid *)&afid->Fid, Outsp,
+ RXAFS_FetchStatus(rxconn, (struct AFSFid *)&afid->Fid, Outsp,
&CallBack, &tsync);
RX_AFS_GLOCK();
} else
code = -1;
} while (afs_Analyze
- (tc, code, afid, areq, AFS_STATS_FS_RPCIDX_FETCHSTATUS,
+ (tc, rxconn, code, afid, areq, AFS_STATS_FS_RPCIDX_FETCHSTATUS,
SHARED_LOCK, NULL));
if (!code) {
char *tbuffer, *ve;
struct afs_conn *tconn;
struct vrequest treq;
+ struct rx_connection *rxconn;
if (strlen(aname) > VL_MAXNAMELEN) /* Invalid volume name */
return NULL;
do {
tconn =
afs_ConnByMHosts(tcell->cellHosts, tcell->vlport, tcell->cellNum,
- &treq, SHARED_LOCK);
+ &treq, SHARED_LOCK, &rxconn);
if (tconn) {
if (tconn->parent->srvr->server->flags & SNO_LHOSTS) {
type = 0;
RX_AFS_GUNLOCK();
- code = VL_GetEntryByNameO(tconn->id, aname, tve);
+ code = VL_GetEntryByNameO(rxconn, aname, tve);
RX_AFS_GLOCK();
} else if (tconn->parent->srvr->server->flags & SYES_LHOSTS) {
type = 1;
RX_AFS_GUNLOCK();
- code = VL_GetEntryByNameN(tconn->id, aname, ntve);
+ code = VL_GetEntryByNameN(rxconn, aname, ntve);
RX_AFS_GLOCK();
} else {
type = 2;
RX_AFS_GUNLOCK();
- code = VL_GetEntryByNameU(tconn->id, aname, utve);
+ code = VL_GetEntryByNameU(rxconn, aname, utve);
RX_AFS_GLOCK();
if (!(tconn->parent->srvr->server->flags & SVLSRV_UUID)) {
if (code == RXGEN_OPCODE) {
type = 1;
RX_AFS_GUNLOCK();
- code = VL_GetEntryByNameN(tconn->id, aname, ntve);
+ code = VL_GetEntryByNameN(rxconn, aname, ntve);
RX_AFS_GLOCK();
if (code == RXGEN_OPCODE) {
type = 0;
tconn->parent->srvr->server->flags |= SNO_LHOSTS;
RX_AFS_GUNLOCK();
- code = VL_GetEntryByNameO(tconn->id, aname, tve);
+ code = VL_GetEntryByNameO(rxconn, aname, tve);
RX_AFS_GLOCK();
} else if (!code)
tconn->parent->srvr->server->flags |= SYES_LHOSTS;
}
} else
code = -1;
- } while (afs_Analyze(tconn, code, NULL, &treq, -1, /* no op code for this */
+ } while (afs_Analyze(tconn, rxconn, code, NULL, &treq, -1, /* no op code for this */
SHARED_LOCK, tcell));
if (code) {
bulkaddrs addrs;
ListAddrByAttributes attrs;
afsUUID uuid;
+ struct rx_connection *rxconn;
memset(&attrs, 0, sizeof(attrs));
attrs.Mask = VLADDR_UUID;
do {
tconn =
afs_ConnByMHosts(tcell->cellHosts, tcell->vlport,
- tcell->cellNum, areq, SHARED_LOCK);
+ tcell->cellNum, areq, SHARED_LOCK,
+ &rxconn);
if (tconn) {
RX_AFS_GUNLOCK();
code =
- VL_GetAddrsU(tconn->id, &attrs, &uuid, &unique,
+ VL_GetAddrsU(rxconn, &attrs, &uuid, &unique,
&nentries, &addrs);
RX_AFS_GLOCK();
} else {
code = VL_NOENT;
} while (afs_Analyze
- (tconn, code, NULL, areq, -1, SHARED_LOCK, tcell));
+ (tconn, rxconn, code, NULL, areq, -1, SHARED_LOCK, tcell));
if (code) {
/* Better handing of such failures; for now we'll simply retry this call */
areq->volumeError = 1;