]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/sunrpc/pmap_clnt.c
SUNRPC: display human-readable procedure name in rpc_iostats output
[karo-tx-linux.git] / net / sunrpc / pmap_clnt.c
index a398575f94b8a1dd1a9da067c597ccdd7bb24ce3..efa00bd9ff9e80d9cdf7fdd68163809305757dc3 100644 (file)
@@ -82,6 +82,7 @@ rpc_getport(struct rpc_task *task, struct rpc_clnt *clnt)
        rpc_call_setup(child, &msg, 0);
 
        /* ... and run the child task */
+       task->tk_xprt->stat.bind_count++;
        rpc_run_child(task, child, pmap_getport_done);
        return;
 
@@ -90,8 +91,7 @@ bailout:
        map->pm_binding = 0;
        rpc_wake_up(&map->pm_bindwait);
        spin_unlock(&pmap_lock);
-       task->tk_status = -EIO;
-       task->tk_action = NULL;
+       rpc_exit(task, -EIO);
 }
 
 #ifdef CONFIG_ROOT_NFS
@@ -132,21 +132,22 @@ static void
 pmap_getport_done(struct rpc_task *task)
 {
        struct rpc_clnt *clnt = task->tk_client;
+       struct rpc_xprt *xprt = task->tk_xprt;
        struct rpc_portmap *map = clnt->cl_pmap;
 
        dprintk("RPC: %4d pmap_getport_done(status %d, port %d)\n",
                        task->tk_pid, task->tk_status, clnt->cl_port);
+
+       xprt->ops->set_port(xprt, 0);
        if (task->tk_status < 0) {
                /* Make the calling task exit with an error */
-               task->tk_action = NULL;
+               task->tk_action = rpc_exit_task;
        } else if (clnt->cl_port == 0) {
                /* Program not registered */
-               task->tk_status = -EACCES;
-               task->tk_action = NULL;
+               rpc_exit(task, -EACCES);
        } else {
-               /* byte-swap port number first */
+               xprt->ops->set_port(xprt, clnt->cl_port);
                clnt->cl_port = htons(clnt->cl_port);
-               clnt->cl_xprt->addr.sin_port = clnt->cl_port;
        }
        spin_lock(&pmap_lock);
        map->pm_binding = 0;
@@ -207,7 +208,7 @@ pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto, int privileg
        xprt = xprt_create_proto(proto, srvaddr, NULL);
        if (IS_ERR(xprt))
                return (struct rpc_clnt *)xprt;
-       xprt->addr.sin_port = htons(RPC_PMAP_PORT);
+       xprt->ops->set_port(xprt, RPC_PMAP_PORT);
        if (!privileged)
                xprt->resvport = 0;
 
@@ -217,7 +218,6 @@ pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto, int privileg
                                RPC_AUTH_UNIX);
        if (!IS_ERR(clnt)) {
                clnt->cl_softrtry = 1;
-               clnt->cl_chatty   = 1;
                clnt->cl_oneshot  = 1;
        }
        return clnt;
@@ -261,6 +261,8 @@ static struct rpc_procinfo  pmap_procedures[] = {
          .p_decode             = (kxdrproc_t) xdr_decode_bool,
          .p_bufsiz             = 4,
          .p_count              = 1,
+         .p_statidx            = PMAP_SET,
+         .p_name               = "SET",
        },
 [PMAP_UNSET] = {
          .p_proc               = PMAP_UNSET,
@@ -268,6 +270,8 @@ static struct rpc_procinfo  pmap_procedures[] = {
          .p_decode             = (kxdrproc_t) xdr_decode_bool,
          .p_bufsiz             = 4,
          .p_count              = 1,
+         .p_statidx            = PMAP_UNSET,
+         .p_name               = "UNSET",
        },
 [PMAP_GETPORT] = {
          .p_proc               = PMAP_GETPORT,
@@ -275,6 +279,8 @@ static struct rpc_procinfo  pmap_procedures[] = {
          .p_decode             = (kxdrproc_t) xdr_decode_port,
          .p_bufsiz             = 4,
          .p_count              = 1,
+         .p_statidx            = PMAP_GETPORT,
+         .p_name               = "GETPORT",
        },
 };