]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sunrpc/clnt.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6-omap-h63xx.git] / net / sunrpc / clnt.c
index 7dda32851adb90bbbc411259fbefeebca231fa81..76739e928d0da5ff99b748ac61538e2bfc03fbf4 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <linux/module.h>
 #include <linux/types.h>
+#include <linux/kallsyms.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/smp_lock.h>
@@ -323,6 +324,8 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
                clnt->cl_autobind = 1;
        if (args->flags & RPC_CLNT_CREATE_DISCRTRY)
                clnt->cl_discrtry = 1;
+       if (!(args->flags & RPC_CLNT_CREATE_QUIET))
+               clnt->cl_chatty = 1;
 
        return clnt;
 }
@@ -939,11 +942,9 @@ call_bind_status(struct rpc_task *task)
        }
 
        switch (task->tk_status) {
-       case -EAGAIN:
-               dprintk("RPC: %5u rpcbind waiting for another request "
-                               "to finish\n", task->tk_pid);
-               /* avoid busy-waiting here -- could be a network outage. */
-               rpc_delay(task, 5*HZ);
+       case -ENOMEM:
+               dprintk("RPC: %5u rpcbind out of memory\n", task->tk_pid);
+               rpc_delay(task, HZ >> 2);
                goto retry_timeout;
        case -EACCES:
                dprintk("RPC: %5u remote rpcbind: RPC program/version "
@@ -1148,7 +1149,8 @@ call_status(struct rpc_task *task)
                rpc_exit(task, status);
                break;
        default:
-               printk("%s: RPC call returned error %d\n",
+               if (clnt->cl_chatty)
+                       printk("%s: RPC call returned error %d\n",
                               clnt->cl_protname, -status);
                rpc_exit(task, status);
        }
@@ -1173,7 +1175,8 @@ call_timeout(struct rpc_task *task)
        task->tk_timeouts++;
 
        if (RPC_IS_SOFT(task)) {
-               printk(KERN_NOTICE "%s: server %s not responding, timed out\n",
+               if (clnt->cl_chatty)
+                       printk(KERN_NOTICE "%s: server %s not responding, timed out\n",
                                clnt->cl_protname, clnt->cl_server);
                rpc_exit(task, -EIO);
                return;
@@ -1181,7 +1184,8 @@ call_timeout(struct rpc_task *task)
 
        if (!(task->tk_flags & RPC_CALL_MAJORSEEN)) {
                task->tk_flags |= RPC_CALL_MAJORSEEN;
-               printk(KERN_NOTICE "%s: server %s not responding, still trying\n",
+               if (clnt->cl_chatty)
+                       printk(KERN_NOTICE "%s: server %s not responding, still trying\n",
                        clnt->cl_protname, clnt->cl_server);
        }
        rpc_force_rebind(clnt);
@@ -1212,8 +1216,9 @@ call_decode(struct rpc_task *task)
                        task->tk_pid, task->tk_status);
 
        if (task->tk_flags & RPC_CALL_MAJORSEEN) {
-               printk(KERN_NOTICE "%s: server %s OK\n",
-                       clnt->cl_protname, clnt->cl_server);
+               if (clnt->cl_chatty)
+                       printk(KERN_NOTICE "%s: server %s OK\n",
+                               clnt->cl_protname, clnt->cl_server);
                task->tk_flags &= ~RPC_CALL_MAJORSEEN;
        }
 
@@ -1528,44 +1533,48 @@ EXPORT_SYMBOL_GPL(rpc_call_null);
 #ifdef RPC_DEBUG
 static void rpc_show_header(void)
 {
-       printk(KERN_INFO "-pid- proc flgs status -client- -prog- --rqstp- "
-               "-timeout -rpcwait -action- ---ops--\n");
+       printk(KERN_INFO "-pid- flgs status -client- --rqstp- "
+               "-timeout ---ops--\n");
+}
+
+static void rpc_show_task(const struct rpc_clnt *clnt,
+                         const struct rpc_task *task)
+{
+       const char *rpc_waitq = "none";
+       char *p, action[KSYM_SYMBOL_LEN];
+
+       if (RPC_IS_QUEUED(task))
+               rpc_waitq = rpc_qname(task->tk_waitqueue);
+
+       /* map tk_action pointer to a function name; then trim off
+        * the "+0x0 [sunrpc]" */
+       sprint_symbol(action, (unsigned long)task->tk_action);
+       p = strchr(action, '+');
+       if (p)
+               *p = '\0';
+
+       printk(KERN_INFO "%5u %04x %6d %8p %8p %8ld %8p %sv%u %s a:%s q:%s\n",
+               task->tk_pid, task->tk_flags, task->tk_status,
+               clnt, task->tk_rqstp, task->tk_timeout, task->tk_ops,
+               clnt->cl_protname, clnt->cl_vers, rpc_proc_name(task),
+               action, rpc_waitq);
 }
 
 void rpc_show_tasks(void)
 {
        struct rpc_clnt *clnt;
-       struct rpc_task *t;
+       struct rpc_task *task;
        int header = 0;
 
        spin_lock(&rpc_client_lock);
        list_for_each_entry(clnt, &all_clients, cl_clients) {
                spin_lock(&clnt->cl_lock);
-               list_for_each_entry(t, &clnt->cl_tasks, tk_task) {
-                       const char *rpc_waitq = "none";
-                       int proc;
-
+               list_for_each_entry(task, &clnt->cl_tasks, tk_task) {
                        if (!header) {
                                rpc_show_header();
                                header++;
                        }
-
-                       if (t->tk_msg.rpc_proc)
-                               proc = t->tk_msg.rpc_proc->p_proc;
-                       else
-                               proc = -1;
-
-                       if (RPC_IS_QUEUED(t))
-                               rpc_waitq = rpc_qname(t->tk_waitqueue);
-
-                       printk("%5u %04d %04x %6d %8p %6d %8p %8ld %8s %8p %8p\n",
-                               t->tk_pid, proc,
-                               t->tk_flags, t->tk_status,
-                               t->tk_client,
-                               (t->tk_client ? t->tk_client->cl_prog : 0),
-                               t->tk_rqstp, t->tk_timeout,
-                               rpc_waitq,
-                               t->tk_action, t->tk_ops);
+                       rpc_show_task(clnt, task);
                }
                spin_unlock(&clnt->cl_lock);
        }