sysctl: remove "struct file *" argument of ->proc_handler
[safe/jmp/linux-2.6] / net / sunrpc / sysctl.c
index bada7de..42f9748 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/sunrpc/types.h>
 #include <linux/sunrpc/sched.h>
 #include <linux/sunrpc/stats.h>
+#include <linux/sunrpc/svc_xprt.h>
 
 /*
  * Declare the debug flags here
@@ -55,8 +56,22 @@ rpc_unregister_sysctl(void)
        }
 }
 
+static int proc_do_xprt(ctl_table *table, int write,
+                       void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+       char tmpbuf[256];
+       size_t len;
+
+       if ((*ppos && !write) || !*lenp) {
+               *lenp = 0;
+               return 0;
+       }
+       len = svc_print_xprts(tmpbuf, sizeof(tmpbuf));
+       return simple_read_from_buffer(buffer, *lenp, ppos, tmpbuf, len);
+}
+
 static int
-proc_dodebug(ctl_table *table, int write, struct file *file,
+proc_dodebug(ctl_table *table, int write,
                                void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        char            tmpbuf[20], c, *s;
@@ -147,6 +162,12 @@ static ctl_table debug_table[] = {
                .mode           = 0644,
                .proc_handler   = &proc_dodebug
        },
+       {
+               .procname       = "transports",
+               .maxlen         = 256,
+               .mode           = 0444,
+               .proc_handler   = &proc_do_xprt,
+       },
        { .ctl_name = 0 }
 };