+
+ info->start = now_hires();
+ info->callback = completion_handler;
+ info->user_data = user_data;
+ g_hash_table_insert(nfs->xid_table,
+ GINT_TO_POINTER(GUINT32_FROM_BE(header.xid)), info);
+}
+
+static void process_reply(NFSConnection *nfs, GString *msg)
+{
+ struct rpc_reply *reply = (struct rpc_reply *)msg->str;
+
+ uint32_t xid = GUINT32_FROM_BE(reply->xid);
+
+ gpointer key = GINT_TO_POINTER(GUINT32_FROM_BE(reply->xid));
+ CallInfo *info = g_hash_table_lookup(nfs->xid_table, key);
+ if (info == NULL) {
+ g_print("Could not match reply XID %d with a call!\n", xid);
+ return;
+ }
+
+ info->end = now_hires();
+ g_print("Call(XID = %d) duration: %"PRIi64" ns\n",
+ xid, info->end - info->start);
+ if (info->callback != NULL)
+ info->callback(nfs, info->user_data);
+
+ g_hash_table_remove(nfs->xid_table, key);
+ g_free(info);