extern BlueSkyFS *fs;
static int outstanding_rpcs = 0;
+static struct bluesky_stats *rpc_recv_stats, *rpc_send_stats;
/* TCP port number to use for NFS protocol. (Should be 2049.) */
#define NFS_SERVICE_PORT 2051
/* For UDP, a connection only exists for the duration of a single
* message. */
g_mutex_free(req->connection->send_lock);
+ g_string_free(req->connection->msgbuf, TRUE);
g_string_free(req->connection->sendbuf, TRUE);
g_free(req->connection);
}
}
g_atomic_int_add(&outstanding_rpcs, -1);
+ bluesky_stats_add(rpc_send_stats, str->len);
struct rpc_reply header;
header.xid = htonl(req->xid);
/* For UDP, a connection only exists for the duration of a single
* message. */
g_mutex_free(req->connection->send_lock);
+ g_string_free(req->connection->msgbuf, TRUE);
g_string_free(req->connection->sendbuf, TRUE);
g_free(req->connection);
}
GString *msg = rpc->msgbuf;
const char *buf = msg->str;
+ bluesky_stats_add(rpc_recv_stats, msg->len);
+
if (msg->len < sizeof(struct rpc_call_header)) {
fprintf(stderr, "Short RPC message: only %zd bytes!\n", msg->len);
return FALSE;
{
SVCXPRT *transp;
+ rpc_recv_stats = bluesky_stats_new("NFS RPC Messages In");
+ rpc_send_stats = bluesky_stats_new("NFS RPC Messages Out");
+
async_rpc_init();
/* MOUNT protocol */