summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorEric Norum <WENorum@lbl.gov>2008-04-25 17:00:48 +0000
committerEric Norum <WENorum@lbl.gov>2008-04-25 17:00:48 +0000
commiteae4a193d3e718ab4bb9b186ffc603e80fb3b0e9 (patch)
tree8726e7e421515aac2f6442435958a8d302ae5f6f /cpukit
parent2008-04-25 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-eae4a193d3e718ab4bb9b186ffc603e80fb3b0e9.tar.bz2
Handle cluster servers better.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libfs/src/nfsclient/src/rpcio.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/cpukit/libfs/src/nfsclient/src/rpcio.c b/cpukit/libfs/src/nfsclient/src/rpcio.c
index 302027d33d..65ec1d33c5 100644
--- a/cpukit/libfs/src/nfsclient/src/rpcio.c
+++ b/cpukit/libfs/src/nfsclient/src/rpcio.c
@@ -352,6 +352,8 @@ typedef struct RpcUdpXactPoolRec_ {
* number of all created transactions in the system.
*/
static RpcUdpXact xactHashTbl[XACT_HASHS]={0};
+static u_long xidUpper [XACT_HASHS]={0};
+static unsigned xidHashSeed = 0 ;
/* forward declarations */
static RpcUdpXact
@@ -683,6 +685,7 @@ register int i,j;
/* pick a free table slot and initialize the XID */
rval->obuf.xid = time(0) ^ (unsigned long)rval;
MU_LOCK(hlock);
+ rval->obuf.xid = (xidHashSeed++ ^ ((unsigned long)rval>>10)) & XACT_HASH_MSK;
i=j=(rval->obuf.xid & XACT_HASH_MSK);
if (msgQ) {
/* if there's no message queue, refuse to
@@ -707,7 +710,7 @@ register int i,j;
MY_FREE(rval);
return 0;
}
- rval->obuf.xid = (rval->obuf.xid << LD_XACT_HASH) | i;
+ rval->obuf.xid = xidUpper[i] | i;
rval->xdrpos = XDR_GETPOS(&(rval->xdrs));
rval->obufsize = size;
}
@@ -727,6 +730,10 @@ int i = xact->obuf.xid & XACT_HASH_MSK;
MU_LOCK(hlock);
xactHashTbl[i]=0;
+ /* remember XID we used last time so we can avoid
+ * reusing the same one (incremented by rpcUdpSend routine)
+ */
+ xidUpper[i] = xact->obuf.xid & ~XACT_HASH_MSK;
MU_UNLOCK(hlock);
bufFree(&xact->ibuf);