summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-06-04 15:51:35 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-06-05 17:19:34 +0200
commit36ae561c8e4e9a3f724adc4f32d5b08ca9b64016 (patch)
tree5285dc1cb340de8734c25eca2d56960406bde844
parentnfsclient: Fix warnings (diff)
downloadrtems-36ae561c8e4e9a3f724adc4f32d5b08ca9b64016.tar.bz2
nfsclient: Add rpcSetXIDs()
-rw-r--r--cpukit/libfs/src/nfsclient/src/librtemsNfs.h18
-rw-r--r--cpukit/libfs/src/nfsclient/src/rpcio.c12
2 files changed, 30 insertions, 0 deletions
diff --git a/cpukit/libfs/src/nfsclient/src/librtemsNfs.h b/cpukit/libfs/src/nfsclient/src/librtemsNfs.h
index f1b2b4f50c..491c3da5df 100644
--- a/cpukit/libfs/src/nfsclient/src/librtemsNfs.h
+++ b/cpukit/libfs/src/nfsclient/src/librtemsNfs.h
@@ -98,6 +98,24 @@ extern "C" {
*/
extern rtems_task_priority rpciodPriority;
+/**
+ * @brief Sets the XIDs of the RPC transaction hash table.
+ *
+ * The active RPC transactions are stored in a hash table. Each table entry
+ * contains the XID of its corresponding transaction. The XID consists of two
+ * parts. The lower part is determined by the hash table index. The upper
+ * part is incremented in each send operation.
+ *
+ * This function sets the upper part of the XID in all hash table entries.
+ * This can be used to ensure that the XIDs are not reused in a short interval
+ * for example during a boot process or after resets.
+ *
+ * @param[in] xid The upper part is used to set the upper XID part of the hash
+ * table entries.
+ */
+void
+rpcSetXIDs(uint32_t xid);
+
/** Initialize the driver.
*
* Note, called in nfsfs initialise when mount is called.
diff --git a/cpukit/libfs/src/nfsclient/src/rpcio.c b/cpukit/libfs/src/nfsclient/src/rpcio.c
index cddcb3260b..7324e02fd9 100644
--- a/cpukit/libfs/src/nfsclient/src/rpcio.c
+++ b/cpukit/libfs/src/nfsclient/src/rpcio.c
@@ -932,6 +932,18 @@ rxWakeupCB(struct socket *sock, void *arg)
rtems_event_send(*rpciod, RPCIOD_RX_EVENT);
}
+void
+rpcSetXIDs(uint32_t xid)
+{
+ uint32_t i;
+
+ xid &= ~XACT_HASH_MSK;
+
+ for (i = 0; i < XACT_HASHS; ++i) {
+ xidUpper[i] = xid | i;
+ }
+}
+
int
rpcUdpInit(void)
{