patch-2.1.79 linux/net/sunrpc/sched.c

Next file: linux/net/sunrpc/stats.c
Previous file: linux/net/sunrpc/clnt.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.78/linux/net/sunrpc/sched.c linux/net/sunrpc/sched.c
@@ -16,6 +16,7 @@
 #include <linux/unistd.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
+
 #include <linux/sunrpc/clnt.h>
 
 #ifdef RPC_DEBUG
@@ -906,3 +907,35 @@
 	up(&rpciod_sema);
 	MOD_DEC_USE_COUNT;
 }
+
+#ifdef RPC_DEBUG
+#include <linux/nfs_fs.h>
+void rpc_show_tasks(void)
+{
+	struct rpc_task *t = all_tasks, *next;
+	struct nfs_wreq *wreq;
+
+	if (!t)
+		return;
+	printk("-pid- proc flgs status -client- --rqstp- -timeout "
+		"-rpcwait -action- --exit--\n");
+	for (; t; t = next) {
+		next = t->tk_next_task;
+		printk("%05d %04d %04x %06d %8p %8p %08ld %8p %8p %8p\n",
+			t->tk_pid, t->tk_proc, t->tk_flags, t->tk_status,
+			t->tk_client, t->tk_rqstp, t->tk_timeout,
+			t->tk_rpcwait, t->tk_action, t->tk_exit);
+
+		if (!(t->tk_flags & RPC_TASK_NFSWRITE))
+			continue;
+		/* NFS write requests */
+		wreq = (struct nfs_wreq *) t->tk_calldata;
+		printk("     NFS: flgs=%08x, pid=%d, pg=%p, off=(%d, %d)\n",
+			wreq->wb_flags, wreq->wb_pid, wreq->wb_page,
+			wreq->wb_offset, wreq->wb_bytes);
+		printk("          name=%s/%s\n",
+			wreq->wb_dentry->d_parent->d_name.name,
+			wreq->wb_dentry->d_name.name);
+	}
+}
+#endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov